diff --git a/go/src/miller/parsing/mlr.bnf b/go/src/miller/parsing/mlr.bnf index b257638dc..21b12a269 100644 --- a/go/src/miller/parsing/mlr.bnf +++ b/go/src/miller/parsing/mlr.bnf @@ -401,7 +401,7 @@ DirectFieldValue IndirectFieldValue : "$[" Rvalue "]" - << dsl.NewASTNodeUnary($0, $1, dsl.NodeTypeIndirectFieldValue) >> + << dsl.NewASTNodeUnary(dsl.NewASTToken("$[]", $0), $1, dsl.NodeTypeIndirectFieldValue) >> ; // * Direct is '$name' @@ -436,7 +436,7 @@ DirectOosvarValue IndirectOosvarValue : "@[" Rvalue "]" - << dsl.NewASTNodeUnary($0, $1, dsl.NodeTypeIndirectOosvarValue) >> + << dsl.NewASTNodeUnary(dsl.NewASTToken("@[]", $0), $1, dsl.NodeTypeIndirectOosvarValue) >> ; // * Direct is '@name' diff --git a/go/src/miller/parsing/parser/productionstable.go b/go/src/miller/parsing/parser/productionstable.go index 141244bef..085c5d68a 100644 --- a/go/src/miller/parsing/parser/productionstable.go +++ b/go/src/miller/parsing/parser/productionstable.go @@ -311,13 +311,13 @@ var productionsTable = ProdTab{ }, }, ProdTabEntry{ - String: `IndirectFieldValue : "$[" Rvalue "]" << dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeIndirectFieldValue) >>`, + String: `IndirectFieldValue : "$[" Rvalue "]" << dsl.NewASTNodeUnary(dsl.NewASTToken("$[]", X[0]), X[1], dsl.NodeTypeIndirectFieldValue) >>`, Id: "IndirectFieldValue", NTType: 13, Index: 28, NumSymbols: 3, ReduceFunc: func(X []Attrib) (Attrib, error) { - return dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeIndirectFieldValue) + return dsl.NewASTNodeUnary(dsl.NewASTToken("$[]", X[0]), X[1], dsl.NodeTypeIndirectFieldValue) }, }, ProdTabEntry{ @@ -381,13 +381,13 @@ var productionsTable = ProdTab{ }, }, ProdTabEntry{ - String: `IndirectOosvarValue : "@[" Rvalue "]" << dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeIndirectOosvarValue) >>`, + String: `IndirectOosvarValue : "@[" Rvalue "]" << dsl.NewASTNodeUnary(dsl.NewASTToken("@[]", X[0]), X[1], dsl.NodeTypeIndirectOosvarValue) >>`, Id: "IndirectOosvarValue", NTType: 18, Index: 35, NumSymbols: 3, ReduceFunc: func(X []Attrib) (Attrib, error) { - return dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeIndirectOosvarValue) + return dsl.NewASTNodeUnary(dsl.NewASTToken("@[]", X[0]), X[1], dsl.NodeTypeIndirectOosvarValue) }, }, ProdTabEntry{ diff --git a/go/u/try-cst.out b/go/u/try-cst.out index 155c39513..9f1555844 100644 --- a/go/u/try-cst.out +++ b/go/u/try-cst.out @@ -1427,7 +1427,7 @@ RAW AST: * StatementBlock * Assignment "=" * DirectFieldValue "new" - * IndirectFieldValue "$[" + * IndirectFieldValue "$[]" * StringLiteral "a" a b i x y new @@ -1444,7 +1444,7 @@ $["new"] = $a RAW AST: * StatementBlock * Assignment "=" - * IndirectFieldValue "$[" + * IndirectFieldValue "$[]" * StringLiteral "new" * DirectFieldValue "a" diff --git a/go/u/try-parse.out b/go/u/try-parse.out index baa5daed5..92cb461cd 100644 --- a/go/u/try-parse.out +++ b/go/u/try-parse.out @@ -132,7 +132,7 @@ $[2] = 3 RAW AST: * StatementBlock * Assignment "=" - * IndirectFieldValue "$[" + * IndirectFieldValue "$[]" * IntLiteral "2" * IntLiteral "3" @@ -145,7 +145,7 @@ $[$y] = 4 RAW AST: * StatementBlock * Assignment "=" - * IndirectFieldValue "$[" + * IndirectFieldValue "$[]" * DirectFieldValue "y" * IntLiteral "4" @@ -170,7 +170,7 @@ $["abc"] = "def" RAW AST: * StatementBlock * Assignment "=" - * IndirectFieldValue "$[" + * IndirectFieldValue "$[]" * StringLiteral "abc" * StringLiteral "def" @@ -183,7 +183,7 @@ $[FILENAME] = FNR RAW AST: * StatementBlock * Assignment "=" - * IndirectFieldValue "$[" + * IndirectFieldValue "$[]" * ContextVariable "FILENAME" * ContextVariable "FNR"