aboutsummaryrefslogtreecommitdiff
path: root/lib/qparser/qsp_instruction.mly
diff options
context:
space:
mode:
authorChimrod <>2023-10-16 16:42:53 +0200
committerChimrod <>2023-10-18 11:19:35 +0200
commit0b75cd5bc0f7d0ad905bce5bebc6e47c927f64d7 (patch)
tree9381b4b3b6c06104d773978f330f073b805a40f0 /lib/qparser/qsp_instruction.mly
parent736456d9952c1d58008f4ca5755913dfff7a32b8 (diff)
Used the dead-end checker in main analysis
Diffstat (limited to 'lib/qparser/qsp_instruction.mly')
-rw-r--r--lib/qparser/qsp_instruction.mly8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/qparser/qsp_instruction.mly b/lib/qparser/qsp_instruction.mly
index fe8a51a..8272cff 100644
--- a/lib/qparser/qsp_instruction.mly
+++ b/lib/qparser/qsp_instruction.mly
@@ -25,7 +25,9 @@ argument(X):
else_opt = preceded(ELSE, instruction)?
{ let loc, expr, statements, loc_s, _body = a in
let elifs = []
- and else_ = Option.to_list else_opt in
+ and else_ = match else_opt with
+ | None -> None
+ | Some instructions -> Some ($loc(else_opt), [ instructions ]) in
Analyzer.Instruction.if_
loc
(loc_s, Helper.v expr, statements)
@@ -33,10 +35,10 @@ argument(X):
~else_
}
| a = onliner(IF)
- else_= preceded(ELSE, inline_action)
+ else_ = preceded(ELSE, inline_action)
{ let loc, expr, statements, loc_s, _body = a in
let elifs = []
- and else_ = [ else_ ] in
+ and else_ = Some ($loc(else_), [ else_ ]) in
Analyzer.Instruction.if_
loc