-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue_1332' into 'master'
Unparsing: add configuration for ExitStmt, GotoStmt and NamedStmt Closes #1332 See merge request eng/libadalang/libadalang!1594
- Loading branch information
Showing
25 changed files
with
561 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
testsuite/tests/unparsing/exit_stmt/long/doc-baseline.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"id": 13, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 12, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 0, | ||
"kind": "text", | ||
"text": "exit Quuux when" | ||
}, | ||
{ | ||
"id": 10, | ||
"kind": "command", | ||
"command": { | ||
"command": "align", | ||
"alignData": { | ||
"kind": "width", | ||
"n": 2 | ||
}, | ||
"alignContents": { | ||
"id": 9, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 1, | ||
"kind": "command", | ||
"command": { | ||
"command": "line", | ||
"literal": false, | ||
"soft": false, | ||
"hard": false | ||
} | ||
}, | ||
{ | ||
"id": 8, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 7, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 2, | ||
"kind": "text", | ||
"text": "Foooooooooooooooooooooooooooooooooooooooooooooooooooooo" | ||
}, | ||
{ | ||
"id": 3, | ||
"kind": "command", | ||
"command": { | ||
"command": "line", | ||
"literal": false, | ||
"soft": false, | ||
"hard": false | ||
} | ||
}, | ||
{ | ||
"id": 4, | ||
"kind": "text", | ||
"text": "and then " | ||
}, | ||
{ | ||
"id": 6, | ||
"kind": "command", | ||
"command": { | ||
"command": "align", | ||
"alignData": { | ||
"kind": "innerRoot" | ||
}, | ||
"alignContents": { | ||
"id": 5, | ||
"kind": "text", | ||
"text": "Baaaaaaaaaar" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"id": 11, | ||
"kind": "text", | ||
"text": ";" | ||
} | ||
] | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
exit Quuux when Foooooooooooooooooooooooooooooooooooooooooooooooooooooo and then Baaaaaaaaaar; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
exit Quuux when | ||
Foooooooooooooooooooooooooooooooooooooooooooooooooooooo | ||
and then Baaaaaaaaaar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
driver: unparser | ||
rule: exit_stmt | ||
description: | | ||
Test the line break after the `when` keyword and the continuation line | ||
indentation of `f_cond_expr`. |
21 changes: 21 additions & 0 deletions
21
testsuite/tests/unparsing/exit_stmt/no_when/doc-baseline.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"id": 2, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 1, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 0, | ||
"kind": "text", | ||
"text": "exit;" | ||
} | ||
] | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
driver: unparser | ||
rule: exit_stmt | ||
description: | | ||
Test that no line breaks were added. |
58 changes: 58 additions & 0 deletions
58
testsuite/tests/unparsing/exit_stmt/short/doc-baseline.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"id": 7, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 6, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 0, | ||
"kind": "text", | ||
"text": "exit when" | ||
}, | ||
{ | ||
"id": 4, | ||
"kind": "command", | ||
"command": { | ||
"command": "align", | ||
"alignData": { | ||
"kind": "width", | ||
"n": 2 | ||
}, | ||
"alignContents": { | ||
"id": 3, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 1, | ||
"kind": "command", | ||
"command": { | ||
"command": "line", | ||
"literal": false, | ||
"soft": false, | ||
"hard": false | ||
} | ||
}, | ||
{ | ||
"id": 2, | ||
"kind": "text", | ||
"text": "Foo" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"id": 5, | ||
"kind": "text", | ||
"text": ";" | ||
} | ||
] | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exit when Foo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exit when Foo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
driver: unparser | ||
rule: exit_stmt | ||
description: | | ||
Test that no line breaks were added. |
47 changes: 47 additions & 0 deletions
47
testsuite/tests/unparsing/goto_stmt/long/doc-baseline.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"id": 5, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 4, | ||
"kind": "command", | ||
"command": { | ||
"command": "align", | ||
"alignData": { | ||
"kind": "width", | ||
"n": 2 | ||
}, | ||
"alignContents": { | ||
"id": 3, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 0, | ||
"kind": "text", | ||
"text": "goto" | ||
}, | ||
{ | ||
"id": 1, | ||
"kind": "command", | ||
"command": { | ||
"command": "line", | ||
"literal": false, | ||
"soft": false, | ||
"hard": false | ||
} | ||
}, | ||
{ | ||
"id": 2, | ||
"kind": "text", | ||
"text": "Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo;" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
goto Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
goto | ||
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
driver: unparser | ||
rule: goto_stmt | ||
description: | | ||
Test the line break after the `goto` keyword and the continuation line | ||
indentation of `f_label_name`. |
Oops, something went wrong.