mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
Remove pointer accessor check in parser
This commit is contained in:
@@ -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, "::") {
|
||||
|
||||
@@ -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,,]
|
||||
| .........^`},
|
||||
|
||||
Reference in New Issue
Block a user