Skip to content

Commit

Permalink
Merge branch 'mku/MR_access_type' into 'master'
Browse files Browse the repository at this point in the history
Unparsing: Add ConcreteTypeDecl config for TypeAccessDef

Closes #1314

See merge request eng/libadalang/libadalang!1565
  • Loading branch information
CKMonika committed Mar 1, 2024
2 parents c3b3662 + 8803c06 commit cf71a9d
Show file tree
Hide file tree
Showing 22 changed files with 988 additions and 202 deletions.
27 changes: 27 additions & 0 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2049,6 +2049,33 @@
}
}
},
"TypeAccessDef": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_has_not_null"
},
{
"kind": "text",
"text": "access"
},
{
"kind": "recurse_field",
"field": "f_has_all"
},
{
"kind": "recurse_field",
"field": "f_has_constant"
},
{
"kind": "recurse_field",
"field": "f_subtype_indication"
}
]
}
},
"UnconstrainedArrayIndices": {
"node": {
"kind": "align",
Expand Down
138 changes: 138 additions & 0 deletions testsuite/tests/unparsing/access_type_def/access_all/doc-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"id": 17,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 16,
"kind": "list",
"list": [
{
"id": 6,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 5,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "type Aaaaaaaa"
},
{
"id": 2,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 1,
"kind": "list",
"list": [
]
}
}
},
{
"id": 3,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 4,
"kind": "text",
"text": "is"
}
]
},
"break": false,
"expandedStates": null
}
},
{
"id": 14,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 13,
"kind": "list",
"list": [
{
"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": 10,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 9,
"kind": "list",
"list": [
{
"id": 8,
"kind": "text",
"text": "access all Bbbbbbbbbbbbbbb"
}
]
},
"break": false,
"expandedStates": null
}
}
]
},
"break": false,
"expandedStates": null
}
}
]
}
}
},
{
"id": 15,
"kind": "text",
"text": ";"
}
]
},
"break": false,
"expandedStates": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type Aaaaaaaa is access all Bbbbbbbbbbbbbbb;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type Aaaaaaaa is access all Bbbbbbbbbbbbbbb;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: |
This test checks the formatting of a simple access all
type declaration.
It is expected the declaration stays on a single line.
driver: unparser
rule: type_decl
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"id": 17,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 16,
"kind": "list",
"list": [
{
"id": 6,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 5,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "type Aaaaaaaa"
},
{
"id": 2,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 1,
"kind": "list",
"list": [
]
}
}
},
{
"id": 3,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 4,
"kind": "text",
"text": "is"
}
]
},
"break": false,
"expandedStates": null
}
},
{
"id": 14,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 13,
"kind": "list",
"list": [
{
"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": 10,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 9,
"kind": "list",
"list": [
{
"id": 8,
"kind": "text",
"text": "access BBBBBBBBBBBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
}
]
},
"break": false,
"expandedStates": null
}
}
]
},
"break": false,
"expandedStates": null
}
}
]
}
}
},
{
"id": 15,
"kind": "text",
"text": ";"
}
]
},
"break": false,
"expandedStates": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type Aaaaaaaa is access BBBBBBBBBBBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
type Aaaaaaaa is
access BBBBBBBBBBBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description: |
This test checks the formatting of a simple access type declaration
having a long subtype indication.
It is expected the declaration be splitted after `is` keyword and
the new line be indented with a line continuation indentation.
driver: unparser
rule: type_decl
Loading

0 comments on commit cf71a9d

Please sign in to comment.