-
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 'mku/raise_stmt' into 'master'
Unparsing: Add RaiseStmt and RaiseExpr config Closes #1371 See merge request eng/libadalang/libadalang!1629
- Loading branch information
Showing
25 changed files
with
436 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
63 changes: 63 additions & 0 deletions
63
testsuite/tests/unparsing/raise_expr/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,63 @@ | ||
{ | ||
"id": 7, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 6, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 0, | ||
"kind": "text", | ||
"text": "raise VeeeeeeeeeeeeryyyyyyyyLoooongNotImplementedError" | ||
}, | ||
{ | ||
"id": 5, | ||
"kind": "command", | ||
"command": { | ||
"command": "align", | ||
"alignData": { | ||
"kind": "width", | ||
"n": 2 | ||
}, | ||
"alignContents": { | ||
"id": 4, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 3, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 1, | ||
"kind": "command", | ||
"command": { | ||
"command": "line", | ||
"literal": false, | ||
"soft": false, | ||
"hard": false | ||
} | ||
}, | ||
{ | ||
"id": 2, | ||
"kind": "text", | ||
"text": "with \"a looooooooooooong too bad message\"" | ||
} | ||
] | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"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 @@ | ||
raise VeeeeeeeeeeeeryyyyyyyyLoooongNotImplementedError with "a looooooooooooong too bad message" |
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 @@ | ||
raise VeeeeeeeeeeeeryyyyyyyyLoooongNotImplementedError | ||
with "a looooooooooooong too bad message" |
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,8 @@ | ||
description: | | ||
This test checks the formatting of a raise expression | ||
with the line length exceeded. | ||
It is expected the expression breaks before the `with` | ||
keyword and the new line be indented. | ||
driver: unparser | ||
rule: raise_expr |
63 changes: 63 additions & 0 deletions
63
testsuite/tests/unparsing/raise_expr/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,63 @@ | ||
{ | ||
"id": 7, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 6, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 0, | ||
"kind": "text", | ||
"text": "raise NotImplementedError" | ||
}, | ||
{ | ||
"id": 5, | ||
"kind": "command", | ||
"command": { | ||
"command": "align", | ||
"alignData": { | ||
"kind": "width", | ||
"n": 2 | ||
}, | ||
"alignContents": { | ||
"id": 4, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 3, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 1, | ||
"kind": "command", | ||
"command": { | ||
"command": "line", | ||
"literal": false, | ||
"soft": false, | ||
"hard": false | ||
} | ||
}, | ||
{ | ||
"id": 2, | ||
"kind": "text", | ||
"text": "with \"too bad\"" | ||
} | ||
] | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"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 @@ | ||
raise NotImplementedError with "too bad" |
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 @@ | ||
raise NotImplementedError with "too bad" |
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,6 @@ | ||
description: | | ||
This test checks the formatting of a raise expression. | ||
It is expected the expression stays on a single line. | ||
driver: unparser | ||
rule: raise_expr |
68 changes: 68 additions & 0 deletions
68
testsuite/tests/unparsing/raise_stmt/long_with_expr_and_message/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,68 @@ | ||
{ | ||
"id": 8, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 7, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 0, | ||
"kind": "text", | ||
"text": "raise VeeeeeeeeeeeeryyyyyyyyLoooongNotImplementedError" | ||
}, | ||
{ | ||
"id": 5, | ||
"kind": "command", | ||
"command": { | ||
"command": "align", | ||
"alignData": { | ||
"kind": "width", | ||
"n": 2 | ||
}, | ||
"alignContents": { | ||
"id": 4, | ||
"kind": "command", | ||
"command": { | ||
"command": "group", | ||
"id": 0, | ||
"groupContents": { | ||
"id": 3, | ||
"kind": "list", | ||
"list": [ | ||
{ | ||
"id": 1, | ||
"kind": "command", | ||
"command": { | ||
"command": "line", | ||
"literal": false, | ||
"soft": false, | ||
"hard": false | ||
} | ||
}, | ||
{ | ||
"id": 2, | ||
"kind": "text", | ||
"text": "with \"a looooooooooooong too bad message\"" | ||
} | ||
] | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"id": 6, | ||
"kind": "text", | ||
"text": ";" | ||
} | ||
] | ||
}, | ||
"break": false, | ||
"expandedStates": null | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
testsuite/tests/unparsing/raise_stmt/long_with_expr_and_message/input.ada
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 @@ | ||
raise VeeeeeeeeeeeeryyyyyyyyLoooongNotImplementedError with "a looooooooooooong too bad message"; |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/unparsing/raise_stmt/long_with_expr_and_message/test.out
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 @@ | ||
raise VeeeeeeeeeeeeryyyyyyyyLoooongNotImplementedError | ||
with "a looooooooooooong too bad message"; |
8 changes: 8 additions & 0 deletions
8
testsuite/tests/unparsing/raise_stmt/long_with_expr_and_message/test.yaml
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,8 @@ | ||
description: | | ||
This test checks the formatting of a raise statement | ||
with the line length exceeded. | ||
It is expected the statement breaks before the `with` | ||
keyword and the new line be indented. | ||
driver: unparser | ||
rule: raise_stmt |
21 changes: 21 additions & 0 deletions
21
testsuite/tests/unparsing/raise_stmt/simple/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": "raise;" | ||
} | ||
] | ||
}, | ||
"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 @@ | ||
raise; |
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 @@ | ||
raise; |
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,6 @@ | ||
description: | | ||
This test checks the formatting of a raise statement. | ||
It is expected the statement stays on a single line. | ||
driver: unparser | ||
rule: raise_stmt |
Oops, something went wrong.