The let keyword to create local variables. Basic syntax: let NAME [OP STATEMENT];
Inheritance: Keyword
Esempio n. 1
0
        public override Expression Scan(ParseEngine engine)
        {
            var start = engine.Pointer;
            var kw = new LetKeyword(engine.CurrentLine, engine.CurrentColumn, engine.Query);
            engine.Advance(Token.Length);
            kw.Length = engine.Pointer - start;
            engine.Skip();
            start = engine.Pointer;
            kw.name = engine.Elements.FindExpression<SymbolExpression>().Scan(engine) as SymbolExpression;

            if (kw.name == null)
            {
                engine.AddError(new YAMPVariableNameMissing(engine), kw);
                return kw;
            }

            engine.SetPointer(start);
            return kw;
        }
Esempio n. 2
0
        public override Expression Scan(ParseEngine engine)
        {
            var start = engine.Pointer;
            var kw    = new LetKeyword(engine.CurrentLine, engine.CurrentColumn, engine.Query);

            engine.Advance(Token.Length);
            kw.Length = engine.Pointer - start;
            engine.Skip();
            start   = engine.Pointer;
            kw.name = Elements.Instance.FindExpression <SymbolExpression>().Scan(engine) as SymbolExpression;

            if (kw.name == null)
            {
                engine.AddError(new YAMPVariableNameMissing(engine), kw);
                return(kw);
            }

            engine.SetPointer(start);
            return(kw);
        }