Skip to content

Commit

Permalink
refactor: minor style change
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoKaios committed Aug 19, 2024
1 parent 2e23793 commit 6f5b607
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- COBOL language configuration for highlighting matching brackets and auto-insertion of line numbers in fixed-format code [#330](https://github.com/OCamlPro/superbol-studio-oss/pull/330)

### Fixed
- Improvements to the grammar [#331](https://github.com/OCamlPro/superbol-studio-oss/pull/331)
- Improvements to the grammar [#331](https://github.com/OCamlPro/superbol-studio-oss/pull/331), [#353](https://github.com/OCamlPro/superbol-studio-oss/pull/353)
- Word wrapping in presence of hyphens [#330](https://github.com/OCamlPro/superbol-studio-oss/pull/330)


Expand Down
10 changes: 6 additions & 4 deletions src/lsp/cobol_parser/grammar.mly
Original file line number Diff line number Diff line change
Expand Up @@ -3454,11 +3454,13 @@ let go_to_statement :=
| GO; TO?; %prec lowest
{ LoneGoTo } (* COB85; obsolete; should be sole statement of paragraph *)
| GO; TO?; target = procedure_name;
depending_on_clause = o(pair(rl(procedure_name), DEPENDING; ON?; ident));
depending_on_clause = ro(pair(rl(procedure_name), DEPENDING; ON?; ident));
{ match depending_on_clause with
| None -> GoTo (GoToSimple { target = target })
| Some (other_targets, depending_on) -> GoTo (GoToDepending
{ targets = NEL.of_list (target :: other_targets); depending_on }) }
| None ->
GoTo (GoToSimple { target })
| Some (other_targets, depending_on) ->
GoTo (GoToDepending { targets = NEL.of_list (target :: other_targets);
depending_on }) }
| GO; TO?; ENTRY; targets = nel_(loc(alphanum));
depending_on = o(DEPENDING; ON?; ident);
{ GoTo (GoToEntry { targets; depending_on }) }
Expand Down
5 changes: 4 additions & 1 deletion src/lsp/cobol_ptree/branching_statements.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ open Simple_statements

(* GOTO *)
type goto_stmt =
| GoToSimple of { target: procedure_name with_loc }
| GoToSimple of
{
target: procedure_name with_loc
}
| GoToDepending of
{
targets: procedure_name with_loc nel;
Expand Down

0 comments on commit 6f5b607

Please sign in to comment.