public ScopedVariableNode( Language.Location location, NameNode scope, NameNode name) { Location = location; Scope = scope ?? throw new ArgumentNullException(nameof(scope)); Name = name ?? throw new ArgumentNullException(nameof(name)); }
protected static Location[] ConvertLocation( Language.Location tokenLocation) { if (tokenLocation == null) { return(null); } return(new[] { new Location( tokenLocation.StartToken.Line, tokenLocation.StartToken.Column) }); }
private static ScopedVariableNode ParseVariable(ParserContext context) { SyntaxToken start = context.ExpectDollar(); NameNode scope = Parser.ParseName(context); context.Expect(TokenKind.Colon); NameNode name = Parser.ParseName(context); Language.Location location = context.CreateLocation(start); return(new ScopedVariableNode ( location, scope, name )); }