diff options
Diffstat (limited to 'lib/qparser/parser.mly')
-rw-r--r-- | lib/qparser/parser.mly | 22 |
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: |