public override bool VisitVarDef([NotNull] injectionParser.VarDefContext context)
        {
            var name = context.SYMBOL()?.GetText() ?? context.assignment()?.lvalue()?.SYMBOL()?.GetText();

            varNames.Add(name);

            return(base.VisitVarDef(context));
        }
Esempio n. 2
0
            public override bool VisitVarDef([NotNull] injectionParser.VarDefContext context)
            {
                if (context.Start.Line < referenceLine)
                {
                    Process(context.SYMBOL() ?? context.assignment().lvalue().SYMBOL());
                }

                return(true);
            }
Esempio n. 3
0
            public override bool VisitVarDef([NotNull] injectionParser.VarDefContext context)
            {
                var name = context.SYMBOL()?.GetText() ?? context.assignment()?.lvalue()?.SYMBOL()?.GetText();

                if (name != null)
                {
                    definitions[name] = context;
                }

                return(base.VisitVarDef(context));
            }
Esempio n. 4
0
        public override InjectionValue VisitVarDef([NotNull] injectionParser.VarDefContext context)
        {
            if (context.assignment() != null)
            {
                if (context.assignment().lvalue().SYMBOL() != null)
                {
                    semanticScope.DefineVar(context.assignment().lvalue().SYMBOL().GetText());
                }
                else
                {
                    throw new NotImplementedException();
                }
                Visit(context.assignment());
            }
            else if (context.SYMBOL() != null)
            {
                semanticScope.DefineVar(context.SYMBOL().GetText());
            }


            return(InjectionValue.Unit);
        }