Exemple #1
0
 private static Symbol?LookupLocalSymbolByName(LocalScope scope, IdentifierSyntax identifierSyntax) =>
 // bind to first symbol matching the specified identifier
 // (errors about duplicate identifiers are emitted elsewhere)
 // loops currently are the only source of local symbols
 // as a result a local scope can contain between 1 to 2 local symbols
 // linear search should be fine, but this should be revisited if the above is no longer holds true
 scope.Declarations.FirstOrDefault(symbol => string.Equals(identifierSyntax.IdentifierName, symbol.Name, LanguageConstants.IdentifierComparison));
Exemple #2
0
 public virtual void VisitLocalScope(LocalScope symbol)
 {
     VisitDescendants(symbol);
 }
Exemple #3
0
 public override void VisitLocalScope(LocalScope symbol)
 {
     this.ScopeMap.Add(symbol.BindingSyntax, symbol);
     base.VisitLocalScope(symbol);
 }
Exemple #4
0
 public override void VisitLocalScope(LocalScope symbol)
 {
     base.VisitLocalScope(symbol);
     this.CollectDiagnostics(symbol);
 }