aboutsummaryrefslogtreecommitdiff
path: root/lib/qparser/parser.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/parser.mly
parent736456d9952c1d58008f4ca5755913dfff7a32b8 (diff)
Used the dead-end checker in main analysis
Diffstat (limited to 'lib/qparser/parser.mly')
-rw-r--r--lib/qparser/parser.mly22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/qparser/parser.mly b/lib/qparser/parser.mly
index fd3f85b..63b9577 100644
--- a/lib/qparser/parser.mly
+++ b/lib/qparser/parser.mly
@@ -10,9 +10,9 @@
-> Analyzer.Expression.t' * Qsp_syntax.Report.t list
; body : Analyzer.Instruction.t Qsp_syntax.S.repr list
; pos : Qsp_syntax.S.pos
- ; else_ : (
+ ; clauses : (
( (Analyzer.Instruction.expression, Analyzer.Instruction.t) Qsp_syntax.S.clause list
- * Analyzer.Instruction.t Qsp_syntax.S.repr list
+ * (Qsp_syntax.S.pos *Analyzer.Instruction.t Qsp_syntax.S.repr list) option
) option )
}
@@ -49,9 +49,9 @@ line_statement:
| s = terminated(inline_action, line_sep)
{ s }
| a = action_bloc(IF, elif_else_body)
- { let {loc; expression; body; pos; else_ } = a in
- let elifs, else_ = match else_ with
- | None -> [], []
+ { let {loc; expression; body; pos; clauses } = a in
+ let elifs, else_ = match clauses with
+ | None -> [], None
| Some (elifs, else_) -> (elifs, else_)
in
Analyzer.Instruction.if_
@@ -78,9 +78,9 @@ line_statement:
line_sep
{
let expression = Helper.v e in
- let else_ = match b with
+ let clauses = match b with
| None -> None
- | Some (elifs, else_) ->
+ | Some (elifs, clauses) ->
let elifs = begin match elifs with
| [] -> []
| _ ->
@@ -91,13 +91,13 @@ line_statement:
)
end in
- Some (elifs, else_)
+ Some (elifs, clauses)
in
{ loc = $loc
; expression
; body = s
- ; else_ = else_
+ ; clauses
; pos = $loc(s)
}
}
@@ -115,8 +115,8 @@ elif:
else_:
| ELSE EOL+
expressions = line_statement*
- { expressions }
- | { [] }
+ { Some ($loc, expressions) }
+ | { None }
elif_else_body: