From 6d7242697b8403ed38c4f34c020cabccda940b86 Mon Sep 17 00:00:00 2001 From: i582 Date: Mon, 26 Jul 2021 14:50:50 +0300 Subject: [PATCH] php8: removed curly braces access for arrays anf strings The changes affected the parser, now an error will be generated when accessing with curly braces, but the AST will be fully built. --- internal/php8/parser_php8_test.go | 35 ++++++++ internal/php8/php8.go | 132 +++++++++++++++--------------- internal/php8/php8.y | 4 + 3 files changed, 107 insertions(+), 64 deletions(-) diff --git a/internal/php8/parser_php8_test.go b/internal/php8/parser_php8_test.go index 43e3ccab..163b0341 100644 --- a/internal/php8/parser_php8_test.go +++ b/internal/php8/parser_php8_test.go @@ -1959,3 +1959,38 @@ new class (name: $a, $b, ...$c) {}; } } } + +func TestCurlyBracesAccessParserError(t *testing.T) { + suite := tester.NewParserErrorTestSuite(t) + suite.UsePHP8() + suite.Code = `