Skip to content

Commit

Permalink
fix: goto stmt grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoKaios committed Aug 19, 2024
1 parent 16d6ee8 commit 668a6e8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lsp/cobol_parser/grammar.mly
Original file line number Diff line number Diff line change
Expand Up @@ -3453,9 +3453,15 @@ let generate_statement :=
let go_to_statement :=
| GO; TO?; %prec lowest
{ LoneGoTo } (* COB85; obsolete; should be sole statement of paragraph *)
| GO; TO?; targets = nel_(procedure_name);
depending_on = o(DEPENDING; ON?; ident);
{ GoTo (GoToSimple { targets; depending_on }) }
| GO; TO?; target = procedure_name;
depending_on = o(pair(rl(procedure_name), DEPENDING; ON?; ident));
{ match depending_on with
| None -> GoTo (GoToSimple
{ targets = NEL.One target;
depending_on = None })
| Some (other_targets, ident) -> GoTo (GoToSimple
{ targets = NEL.of_list (target :: other_targets);
depending_on = Some ident }) }
| GO; TO?; ENTRY; targets = nel_(loc(alphanum));
depending_on = o(DEPENDING; ON?; ident);
{ GoTo (GoToEntry { targets; depending_on }) }
Expand Down

0 comments on commit 668a6e8

Please sign in to comment.