Package org.luaj.vm2.compiler.FuncState

Examples of org.luaj.vm2.compiler.FuncState.BlockCnt


                // Traverse the directions table.
                LuaValue key = LuaValue.NIL;
                while (true) {

                    Varargs keyValue = directionsTable.next(key);
                    key = keyValue.arg1();
                    if (key.isnil()) {
                        break;
                    }
                    LuaValue directionTable = keyValue.arg(2);

                    int x = directionTable.get("x").checkint();
                    int y = directionTable.get("y").checkint();
                    int frameWidth = directionTable.get("frame_width").checkint();
                    int frameHeight = directionTable.get("frame_height").checkint();
View Full Code Here


        final int testCount        = tests.get("count").toint();
        final LuaValue provideFunc = tests.get("provide");
        final LuaValue runFunc     = tests.get("run");

        for (int i=1; i<testCount+1; i++) {
            final Varargs provideValue = provideFunc.invoke(valueOf(i));
            final LuaValue name = provideValue.arg(2);
            final String expected = provideValue.arg(3).checkjstring();

            Description testDescription = Description.createTestDescription(getClass(), name.toString());

            if (isIgnored(testDescription)) {
                notifier.fireTestIgnored(testDescription);
View Full Code Here


  void block () {
    /* block -> chunk */
    FuncState fs = this.fs;
    BlockCnt bl = new BlockCnt();
    fs.enterblock(bl, false);
    this.chunk();
    LuaC._assert(bl.breaklist.i == NO_JUMP);
    fs.leaveblock();
  }
View Full Code Here

  }


  void breakstat() {
    FuncState fs = this.fs;
    BlockCnt bl = fs.bl;
    boolean upval = false;
    while (bl != null && !bl.isbreakable) {
      upval |= bl.upval;
      bl = bl.previous;
    }
View Full Code Here

  void whilestat (int line) {
    /* whilestat -> WHILE cond DO block END */
    FuncState fs = this.fs;
    int whileinit;
    int condexit;
    BlockCnt bl = new BlockCnt();
    this.next()/* skip WHILE */
    whileinit = fs.getlabel();
    condexit = this.cond();
    fs.enterblock(bl, true);
    this.checknext(TK_DO);
View Full Code Here

  void repeatstat(int line) {
    /* repeatstat -> REPEAT block UNTIL cond */
    int condexit;
    FuncState fs = this.fs;
    int repeat_init = fs.getlabel();
    BlockCnt bl1 = new BlockCnt();
    BlockCnt bl2 = new BlockCnt();
    fs.enterblock(bl1, true); /* loop block */
    fs.enterblock(bl2, false); /* scope block */
    this.next(); /* skip REPEAT */
    this.chunk();
    this.check_match(TK_UNTIL, TK_REPEAT, line);
View Full Code Here

  }


  void forbody(int base, int line, int nvars, boolean isnum) {
    /* forbody -> DO block */
    BlockCnt bl = new BlockCnt();
    FuncState fs = this.fs;
    int prep, endfor;
    this.adjustlocalvars(3); /* control variables */
    this.checknext(TK_DO);
    prep = isnum ? fs.codeAsBx(Lua.OP_FORPREP, base, NO_JUMP) : fs.jump();
View Full Code Here

  void forstat(int line) {
    /* forstat -> FOR (fornum | forlist) END */
    FuncState fs = this.fs;
    LuaString varname;
    BlockCnt bl = new BlockCnt();
    fs.enterblock(bl, true); /* scope for loop and control variables */
    this.next(); /* skip `for' */
    varname = this.str_checkname(); /* first variable name */
    switch (this.t.token) {
    case '=':
View Full Code Here

    packageLib = new PackageLib();
    globals.load(packageLib);
    //globals.load(new Bit32Lib()); // not needed for 5.1 compatibility 
    globals.load(new TableLib());
    globals.load(new StringLib());
    globals.load(new CoroutineLib());
    globals.load(new JseMathLib());
    globals.load(new JseIoLib());
    globals.load(new JseOsLib());
    globals.load(new LuajavaLib());
    globals.load(new DebugLib());
View Full Code Here

    globals.load(new CoroutineLib());
    globals.load(new JseMathLib());
    globals.load(new JseIoLib());
    globals.load(new JseOsLib());
    globals.load(new LuajavaLib());
    globals.load(new DebugLib());
    globals.load(new LuaBytesLib(this));
    globals.load(new LuaListLib(this));
    globals.load(new LuaMapLib(this));
    globals.load(new LuaStreamLib(this));
    LuaC.install();
View Full Code Here

TOP

Related Classes of org.luaj.vm2.compiler.FuncState.BlockCnt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.