Skip to content

Commit

Permalink
Merge branch 'mku/derived_type_def' into 'master'
Browse files Browse the repository at this point in the history
Add DerivedTypeDef  and InterfaceTypeDef configuration

Closes #1325 and #1326

See merge request eng/libadalang/libadalang!1586
  • Loading branch information
CKMonika committed Mar 22, 2024
2 parents 8d2a11e + 6bde0d6 commit 11131aa
Showing 61 changed files with 3,450 additions and 0 deletions.
95 changes: 95 additions & 0 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
@@ -839,6 +839,73 @@
"line"
]
},
"DerivedTypeDef": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_has_abstract"
},
{
"kind": "recurse_field",
"field": "f_has_limited"
},
{
"kind": "recurse_field",
"field": "f_has_synchronized"
},
{
"kind": "text",
"text": "new"
},
{
"kind": "innerRoot",
"contents": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_subtype_indication"
},
{
"kind": "recurse_field",
"field": "f_interfaces"
}
]
}
},
{
"kind": "recurse_field",
"field": "f_record_extension"
},
{
"kind": "recurse_field",
"field": "f_has_with_private"
}
]
},
"fields": {
"f_interfaces":{
"kind": "ifEmpty",
"then": "recurse",
"else":
{
"kind": "align",
"width": 1,
"contents": "recurse"
}
},
"f_record_extension":{
"kind": "ifEmpty",
"then": "recurse",
"else": [
"hardlineWithoutBreakParent",
"recurse"
]
}
}
},
"DiscriminantSpec": {
"node": {
"kind": "group",
@@ -1897,6 +1964,25 @@
]
}
},
"InterfaceTypeDef": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_interface_kind"
},
{
"kind": "text",
"text": "interface"
},
{
"kind": "recurse_field",
"field": "f_interfaces"
}
]
}
},
"KnownDiscriminantPart": {
"node": {
"kind": "group",
@@ -2542,6 +2628,15 @@
}
}
},
"ParentList": {
"node": {
"kind": "group",
"document": [
"hardline",
"recurse"
]
}
},
"PragmaArgumentAssoc": {
"node": {
"kind": "group",
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
{
"id": 33,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 32,
"kind": "list",
"list": [
{
"id": 6,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 5,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "type This_Number"
},
{
"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": 30,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 29,
"kind": "list",
"list": [
{
"id": 7,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 28,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 27,
"kind": "list",
"list": [
{
"id": 26,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 25,
"kind": "list",
"list": [
{
"id": 8,
"kind": "text",
"text": "new"
},
{
"id": 24,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 23,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 22,
"kind": "list",
"list": [
{
"id": 9,
"kind": "text",
"text": " Integer"
},
{
"id": 21,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 20,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 19,
"kind": "list",
"list": [
{
"id": 10,
"kind": "text",
"text": " range "
},
{
"id": 18,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 17,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 16,
"kind": "list",
"list": [
{
"id": 11,
"kind": "text",
"text": "0"
},
{
"id": 12,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 13,
"kind": "text",
"text": ".. "
},
{
"id": 15,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 14,
"kind": "text",
"text": "9999"
}
}
}
]
},
"break": false,
"expandedStates": null
}
}
}
}
]
},
"break": false,
"expandedStates": null
}
}
}
}
]
},
"break": false,
"expandedStates": null
}
}
}
}
]
},
"break": false,
"expandedStates": null
}
}
]
},
"break": false,
"expandedStates": null
}
}
]
}
}
},
{
"id": 31,
"kind": "text",
"text": ";"
}
]
},
"break": false,
"expandedStates": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type This_Number is new Integer range 0 .. 9999;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type This_Number is new Integer range 0 .. 9999;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: |
This test checks the formatting of a simple derived type declaration.
It is expected the declaration stays on a single line.
driver: unparser
rule: type_decl
Loading

0 comments on commit 11131aa

Please sign in to comment.