コード例 #1
0
        public List <TokensError> Run()
        {
            List <TokensError> errors = new List <TokensError>();

            TokensBuilder.gen.needLaterCall = false;
            Label endBlock = Context.functionBuilder.generator.DefineLabel();

            LaterCalls.Brfalse(endBlock);            // create statement
            TokensBuilder.gen.ParseExpression(body); // parse body
            LaterCalls.BrEndIf();                    // break to end of all if-else
            TokensBuilder.gen.needLaterCall = false;
            return(errors);
        }
コード例 #2
0
        public List <TokensError> Run()
        {
            List <TokensError> errors = new List <TokensError>();

            TokensBuilder.gen.needLaterCall = false;
            Label endBlock = g.DefineLabel();

            LaterCalls.StartLoop();                  // initilizate start of loop
            LaterCalls.Brfalse(endBlock);            // make statement that points to end of loop |
            TokensBuilder.gen.ParseExpression(body); // parse body                     |
            LaterCalls.BrEndIf();                    // make break to start of loop and mark end of loop <-
            LaterCalls.Call();                       // call all that we write here
            LaterCalls.isLoop = false;               // mark that we heven`t loop now
            return(errors);
        }