Skip to content

Commit

Permalink
U909-016: ParamAssoc error recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
raph-amiard committed Oct 1, 2021
1 parent 09dcd31 commit 52f162c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ada/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,8 @@ def end_named_block():
direct_name=Or(A.identifier, A.string_literal, A.char_literal),

param_assoc=ParamAssoc(
Opt(A.identifier | A.others_designator | A.string_literal, "=>"),
Opt(A.identifier | A.others_designator | A.string_literal,
"=>", cut()),
A.expr | A.box_expr,
),

Expand Down
1 change: 1 addition & 0 deletions testsuite/tests/parser/call_expr_incomplete/input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Foo (Bar => 12, Baz =>
20 changes: 20 additions & 0 deletions testsuite/tests/parser/call_expr_incomplete/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
input:1:17: Cannot parse <param_assoc>
input:2:1: Expected '<>', got Termination
input:1:1: Cannot parse <name>
input:2:1: Expected ')', got Termination
CallExpr[1:1-2:1] <<INCOMPLETE>>
|f_name:
| Id[1:1-1:4]: Foo
|f_suffix:
| AssocList[1:6-2:1] <<INCOMPLETE>>
| | ParamAssoc[1:6-1:15]
| | |f_designator:
| | | Id[1:6-1:9]: Bar
| | |f_r_expr:
| | | Int[1:13-1:15]: 12
| | ParamAssoc[1:17-2:1] <<INCOMPLETE>>
| | |f_designator:
| | | Id[1:17-1:20]: Baz
| | |f_r_expr: <null>

==== Checking tree consistency ====
4 changes: 4 additions & 0 deletions testsuite/tests/parser/call_expr_incomplete/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
driver: parser
check-consistency: true
test-unparsing: false
rule: name

0 comments on commit 52f162c

Please sign in to comment.