Example #1
0
 public object VisitGlobalStatement(GlobalStatement s, object context)
 {
     StringBuilder.Append("global ");
     StringBuilder.Append(s.Name.Content);
     StringBuilder.Append(";");
     return(null);
 }
Example #2
0
 public void VisitGlobal(GlobalStatement g)
 {
     foreach (var name in g.names)
     {
         globals.Add(name.Name);
     }
 }
Example #3
0
 public bool HandleGlobal(GlobalStatement node)
 {
     foreach (var nex in node.Names)
     {
         Eval.CurrentScope.DeclareGlobal(nex.Name, Eval.GetLoc(nex));
     }
     return(false);
 }
Example #4
0
 public Task <bool> HandleGlobalAsync(GlobalStatement node, CancellationToken cancellationToken = default)
 {
     foreach (var nex in node.Names)
     {
         Eval.CurrentScope.DeclareGlobal(nex.Name, Eval.GetLoc(nex));
     }
     return(Task.FromResult(false));
 }
 // GlobalStatement
 public override bool Walk(GlobalStatement node)
 {
     foreach (SymbolId n in node.Names)
     {
         Global(n);
     }
     return(true);
 }
Example #6
0
 public override bool Walk(GlobalStatement node)
 {
     foreach (var name in node.Names)
     {
         GlobalScope.Scope.GetVariable(name, _unit, name.Name);
     }
     return(false);
 }
Example #7
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);
 }
 public override bool Walk(GlobalStatement node)
 {
     foreach (var nex in node.Names)
     {
         var m = Eval.LookupNameInScopes(nex.Name, out _, LookupOptions.Global);
         if (m == null)
         {
             ReportUndefinedVariable(nex);
         }
     }
     return(false);
 }
 private void HandleGlobal(GlobalStatement node)
 {
     foreach (var nex in node.Names)
     {
         var m = Eval.LookupNameInScopes(nex.Name, out _, LookupOptions.Global);
         if (m == null)
         {
             _diagnostics.Add(new DiagnosticsEntry(
                                  Resources.ErrorVariableNotDefinedGlobally.FormatInvariant(nex.Name),
                                  Eval.GetLocation(nex).Span, ErrorCodes.VariableNotDefinedGlobally, Severity.Warning, DiagnosticSource.Linter));
         }
     }
 }
 public bool HandleGlobal(GlobalStatement node)
 {
     foreach (var nex in node.Names)
     {
         var m = Eval.LookupNameInScopes(nex.Name, out _, out var v, LookupOptions.Global);
         if (m != null)
         {
             var location = Eval.GetLocationOfName(nex);
             Eval.CurrentScope.DeclareGlobal(nex.Name, location);
             v?.AddReference(location);
         }
     }
     return(false);
 }
 public override Task <bool> WalkAsync(GlobalStatement node, CancellationToken cancellationToken = default)
 => NonLocalHandler.HandleGlobalAsync(node, cancellationToken);
 // GlobalStatement
 public override bool Walk(GlobalStatement node)
 {
     return(ShouldWalkWorker(node));
 }
Example #13
0
 // GlobalStatement
 public bool Walk(GlobalStatement node)
 {
     return(Process(node));
 }
Example #14
0
 public void PostWalk(GlobalStatement node)
 {
     PostProcess(node);
 }
 private List <Inferred> InferGlobalStatement(GlobalStatement node, Scope scope)
 {
     Debug.Print("Not implemented: InferGlobalStatementIn");
     return(null);
 }
 // GlobalStatement
 public override bool Walk(GlobalStatement node)
 {
     return(Contains(node));
 }
 // GlobalStatement
 public virtual bool Walk(GlobalStatement node) { return true; }
 // GlobalStatement
 public override bool Walk(GlobalStatement node) { return false; }
Example #19
0
 // GlobalStatement
 public virtual bool Walk(GlobalStatement node)
 {
     return(true);
 }
Example #20
0
 public override void PostWalk(GlobalStatement node)
 {
 }
Example #21
0
 public override bool Walk(GlobalStatement node)
 {
     writer.WriteLine("Global");
     return(base.Walk(node));
 }
Example #22
0
 // GlobalStatement
 public override bool Walk(GlobalStatement node) { return Location >= node.StartIndex && Location <= node.EndIndex; }
Example #23
0
 public SymbolTable VisitGlobal(GlobalStatement g)
 {
     throw new NotImplementedException();
 }
Example #24
0
 public void VisitGlobal(GlobalStatement g)
 {
     gen.Comment("GLOBAL " + string.Join(", ", g.names));
 }
 public override void PostWalk(GlobalStatement node)
 {
     PostWalkWorker(node);
 }
Example #26
0
 // GlobalStatement
 public override bool Walk(GlobalStatement node)
 {
     return(false);
 }
Example #27
0
 public DataType VisitGlobal(GlobalStatement g)
 {
     // Do nothing here because global names are processed by VisitSuite
     return(DataType.Cont);
 }
Example #28
0
 // GlobalStatement
 public override bool Walk(GlobalStatement node)
 {
     return(Location >= node.StartIndex && Location <= node.EndIndex);
 }
Example #29
0
 public override bool Walk(GlobalStatement node)
 {
     CanComplete     = IsActualExpression(node.Names);
     CommitByDefault = true;
     return(base.Walk(node));
 }
Example #30
0
 public virtual void PostWalk(GlobalStatement node)
 {
 }
Example #31
0
 public void VisitGlobal(GlobalStatement g)
 {
     gen.Comment("GLOBAL " + string.Join(", ", g.names));
 }
 public virtual void PostWalk(GlobalStatement node) { }
Example #33
0
 public override bool Walk(GlobalStatement node) => Save(node, base.Walk(node), "global");
 public override void PostWalk(GlobalStatement node) { }
Example #35
0
 public void VisitGlobal(GlobalStatement g)
 {
     throw new NotImplementedException();
 }
 public override bool Walk(GlobalStatement node) => NonLocalHandler.HandleGlobal(node);
Example #37
0
        public override bool Walk(GlobalStatement node)
        {
            UpdateLineInfo(node, true);

            return(base.Walk(node));
        }