Skip to content

Commit

Permalink
Add AttributeDefClause and AttributeRef configs
Browse files Browse the repository at this point in the history
  • Loading branch information
CKMonika committed Apr 17, 2024
1 parent 2d1eeec commit 022e61c
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 0 deletions.
54 changes: 54 additions & 0 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,60 @@
}
}
},
"AttributeDefClause": {
"node": {
"kind": "group",
"document": [
{
"kind": "text",
"text": "for"
},
{
"kind": "recurse_field",
"field": "f_attribute_expr"
},
{
"kind": "text",
"text": "use"
},
{
"kind": "align",
"width": 2,
"contents": {
"kind": "recurse_field",
"field": "f_expr"
}
},
{
"kind": "text",
"text": ";"
}
]
}
},
"AttributeRef": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_prefix"
},
{
"kind": "text",
"text": "'"
},
{
"kind": "recurse_field",
"field": "f_attribute"
},
{
"kind": "recurse_field",
"field": "f_args"
}
]
}
},
"AssocList": {
"sep": [
"recurse",
Expand Down
74 changes: 74 additions & 0 deletions testsuite/tests/unparsing/attribute_def_clause/doc-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"id": 10,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 9,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "for"
},
{
"id": 3,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 2,
"kind": "list",
"list": [
{
"id": 1,
"kind": "text",
"text": " Small'Size"
}
]
},
"break": false,
"expandedStates": null
}
},
{
"id": 4,
"kind": "text",
"text": " use"
},
{
"id": 7,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 6,
"kind": "list",
"list": [
{
"id": 5,
"kind": "text",
"text": " 16"
}
]
}
}
},
{
"id": 8,
"kind": "text",
"text": ";"
}
]
},
"break": false,
"expandedStates": null
}
}
1 change: 1 addition & 0 deletions testsuite/tests/unparsing/attribute_def_clause/input.ada
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for Small'Size use 16;
1 change: 1 addition & 0 deletions testsuite/tests/unparsing/attribute_def_clause/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for Small'Size use 16;
7 changes: 7 additions & 0 deletions testsuite/tests/unparsing/attribute_def_clause/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: |
This test checks the formatting of an attribute definition
clause.
It is expected the declaration stays on a single line.
driver: unparser
rule: aspect_clause

0 comments on commit 022e61c

Please sign in to comment.