Remove pointer accessor check in parser

This commit is contained in:
Anton Medvedev
2025-03-08 17:11:49 +01:00
parent 3fc6c1f535
commit 41da963d55
2 changed files with 0 additions and 7 deletions
-4
View File
@@ -385,10 +385,6 @@ func (p *parser) parsePrimary() Node {
}
return p.parsePostfixExpression(node)
}
} else {
if token.Is(Operator, "#") || token.Is(Operator, ".") {
p.error("cannot use pointer accessor outside predicate")
}
}
if token.Is(Operator, "::") {
-3
View File
@@ -875,9 +875,6 @@ func TestParse_error(t *testing.T) {
{`foo({.bar})`, `a map key must be a quoted string, a number, a identifier, or an expression enclosed in parentheses (unexpected token Operator(".")) (1:6)
| foo({.bar})
| .....^`},
{`.foo`, `cannot use pointer accessor outside predicate (1:1)
| .foo
| ^`},
{`[1, 2, 3,,]`, `unexpected token Operator(",") (1:10)
| [1, 2, 3,,]
| .........^`},