public override Task <bool> WalkAsync(ClassDefinition cd, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); var classInfo = CreateClass(cd); _eval.DeclareVariable(cd.Name, classInfo, GetLoc(cd)); _table.Add(new ClassEvaluator(_eval, cd)); // Open class scope _scopes.Push(_eval.OpenScope(cd, out _)); return(Task.FromResult(true)); }
public override bool Walk(ClassDefinition cd) { if (!string.IsNullOrEmpty(cd.NameExpression?.Name)) { var classInfo = CreateClass(cd); _eval.DeclareVariable(cd.Name, classInfo, VariableSource.Declaration, GetLoc(cd)); _table.Add(new ClassEvaluator(_eval, cd)); // Open class scope _scopes.Push(_eval.OpenScope(_eval.Module, cd, out _)); } return(true); }
public override bool Walk(ClassDefinition cd) { if (!string.IsNullOrEmpty(cd.NameExpression?.Name)) { var classInfo = CreateClass(cd); // The variable is transient (non-user declared) hence it does not have location. // Class type is tracking locations for references and renaming. _eval.DeclareVariable(cd.Name, classInfo, VariableSource.Declaration); _table.Add(new ClassEvaluator(_eval, cd)); // Open class scope _scopes.Push(_eval.OpenScope(_eval.Module, cd, out _)); } return(true); }