Skip to content

Commit

Permalink
Merge branch 'gnatformat-issue_46' into 'master'
Browse files Browse the repository at this point in the history
Unparsing: Add config for BeginBlock

Closes eng/ide/gnatformat#46

See merge request eng/libadalang/libadalang!1715
  • Loading branch information
joaopsazevedo committed Jul 30, 2024
2 parents dceeda8 + 8c3313c commit cc3af8d
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 0 deletions.
34 changes: 34 additions & 0 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,40 @@
"must_break": false
}
},
"BeginBlock": {
"node": {
"kind": "group",
"document": [
{
"kind": "text",
"text": "begin"
},
{
"kind": "recurse_field",
"field": "f_stmts"
},
"hardline",
{
"kind": "text",
"text": "end"
},
{
"kind": "recurse_field",
"field": "f_end_name"
},
{
"kind": "text",
"text": ";"
}
]
},
"fields": {
"f_end_name": [
"whitespace",
"recurse"
]
}
},
"BinOp": {
"node": {
"kind": "group",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
begin null; exception when others => null; end;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
begin
null;
exception
when others =>
null;
end;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
driver: unparser
rule: stmt
description: |
Test that the `begin`, `expection` and `end` keywords are aligned.
Also test that `f_stmts.f_stmts` and `f_stmts.f_exceptions` are aligned.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
begin null; end;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
begin
null;
end;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
driver: unparser
rule: stmt
description: |
Test that the `begin` and `end` keywords are aligned and `f_stmts.f_stmts` is
indented.

0 comments on commit cc3af8d

Please sign in to comment.