aboutsummaryrefslogtreecommitdiff
path: root/lib/qparser/parser.mly
diff options
context:
space:
mode:
authorChimrod <>2024-01-19 11:55:15 +0100
committerChimrod <>2024-01-19 11:55:15 +0100
commit86fd78a5ab65015a9c18ad601856f1b16ed90fa9 (patch)
treeef47902c248fe385fffbcf6162001aa81748b895 /lib/qparser/parser.mly
parentc8fb3bdbf3d35c0fd4496d3150961e1fcb202f05 (diff)
Wait to get a valid syntax before considering a new location
Diffstat (limited to 'lib/qparser/parser.mly')
-rw-r--r--lib/qparser/parser.mly9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/qparser/parser.mly b/lib/qparser/parser.mly
index 73d77b7..6fc9b8f 100644
--- a/lib/qparser/parser.mly
+++ b/lib/qparser/parser.mly
@@ -25,7 +25,7 @@
main:
| before_location*
- LOCATION_START
+ start_location
EOL+
instructions = line_statement*
LOCATION_END
@@ -38,6 +38,13 @@ before_location:
| EOL {}
| COMMENT EOL { }
+(* Defer the registration here, and ensure we get a valid rule. *)
+start_location:
+ | l = LOCATION_START
+ {
+ ignore (l ())
+ }
+
(* All these statement should terminate with EOL *)
line_statement:
| COMMENT EOL+ { Analyzer.Instruction.comment $loc }