public void Visit(ArrayIndexAst ast) { throw new NotImplementedException(); }
public void Visit(ArrayIndexAst ast) { ast.Name.Visit(this); ast.Index.Visit(this); if (ResolvingTypes) { var symbol = Resolve(ast.Name); if (!symbol.IsArray) { throw new InvalidSyntax("Trying to index a non array"); } if (ast.Index.AstSymbolType.ExpressionType != ExpressionTypes.Int) { throw new InvalidSyntax("Cannot index an array with a non integer type: " + ast.Index.AstSymbolType.ExpressionType); } } }