Exemplo n.º 1
0
        //global_stmt: 'global' NAME (',' NAME)*
        private GlobalStatement ParseGlobalStmt()
        {
            Eat(TokenKind.KeywordGlobal);
            var start = GetStart();
            string globalWhiteSpace = _tokenWhiteSpace;
            List<string> commaWhiteSpace;
            List<string> namesWhiteSpace;

            var l = ReadNameList(out commaWhiteSpace, out namesWhiteSpace);
            var names = l.ToArray();
            GlobalStatement ret = new GlobalStatement(names);
            ret.SetLoc(start, GetEnd());
            if (_verbatim) {
                AddPreceedingWhiteSpace(ret, globalWhiteSpace);
                AddListWhiteSpace(ret, commaWhiteSpace.ToArray());
                AddNamesWhiteSpace(ret, namesWhiteSpace.ToArray());
            }
            return ret;
        }
Exemplo n.º 2
0
 // GlobalStatement
 public override bool Walk(GlobalStatement node)
 {
     return ShouldWalkWorker(node);
 }
Exemplo n.º 3
0
 public override bool Walk(GlobalStatement node)
 {
     foreach (var name in node.Names) {
         if (name.Name != null) {
             // set the variable in the local scope to be the real variable in the global scope
             _scope.AddVariable(name.Name, _scope.GlobalScope.CreateVariable(node, _curUnit, name.Name, false));
         }
     }
     return false;
 }
Exemplo n.º 4
0
 public override void PostWalk(GlobalStatement node)
 {
     PostWalkWorker(node);
 }