From 0b75cd5bc0f7d0ad905bce5bebc6e47c927f64d7 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 16 Oct 2023 16:42:53 +0200 Subject: Used the dead-end checker in main analysis --- lib/qparser/qsp_instruction.mly | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/qparser/qsp_instruction.mly') 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 -- cgit v1.2.3