Skip to content

Commit

Permalink
Merge branch 'mku/concat_op' into 'master'
Browse files Browse the repository at this point in the history
Adding ConcatOp, ConcatOperand and ConcatOperandList configs

Closes #1367

See merge request eng/libadalang/libadalang!1622
  • Loading branch information
CKMonika committed Apr 17, 2024
2 parents 57716c0 + e758ae2 commit 2807442
Show file tree
Hide file tree
Showing 13 changed files with 2,178 additions and 0 deletions.
38 changes: 38 additions & 0 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,44 @@
}
}
},
"ConcatOp": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_first_operand"
},
"line",
{
"kind": "recurse_field",
"field": "f_other_operands"
}
]
}
},
"ConcatOperand": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_operator"
},
"line",
{
"kind": "recurse_field",
"field": "f_operand"
}
]
}
},
"ConcatOperandList": {
"sep": [
"line",
"recurse"
]
},
"ConstrainedArrayIndices": {
"node": {
"kind": "align",
Expand Down
113 changes: 113 additions & 0 deletions testsuite/tests/unparsing/concat_op/long/doc-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"id": 14,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 13,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\""
},
{
"id": 1,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 6,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 5,
"kind": "list",
"list": [
{
"id": 2,
"kind": "text",
"text": "&"
},
{
"id": 3,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 4,
"kind": "text",
"text": "\"BBBBBBBBBBBBBBBBBBBBBBBB\""
}
]
},
"break": false,
"expandedStates": null
}
},
{
"id": 7,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 12,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 11,
"kind": "list",
"list": [
{
"id": 8,
"kind": "text",
"text": "&"
},
{
"id": 9,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 10,
"kind": "text",
"text": "\"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\""
}
]
},
"break": false,
"expandedStates": null
}
}
]
},
"break": false,
"expandedStates": null
}
}
1 change: 1 addition & 0 deletions testsuite/tests/unparsing/concat_op/long/input.ada
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" & "BBBBBBBBBBBBBBBBBBBBBBBB" & "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
3 changes: 3 additions & 0 deletions testsuite/tests/unparsing/concat_op/long/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
& "BBBBBBBBBBBBBBBBBBBBBBBB"
& "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
7 changes: 7 additions & 0 deletions testsuite/tests/unparsing/concat_op/long/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: |
This test checks the formatting of a concat operation.
It is expected the expression breaks before each `&`
operator.
driver: unparser
rule: simple_expr
Loading

0 comments on commit 2807442

Please sign in to comment.