Skip to content

Commit

Permalink
Merge branch 'issue_1313' into 'master'
Browse files Browse the repository at this point in the history
Unparsing: add configuration for DeclarativePart and HandledStmts

Closes #1313

See merge request eng/libadalang/libadalang!1576
  • Loading branch information
joaopsazevedo committed Mar 18, 2024
2 parents 0cf516e + a5e3909 commit c27436c
Show file tree
Hide file tree
Showing 17 changed files with 1,590 additions and 1,248 deletions.
81 changes: 60 additions & 21 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,25 @@
]
}
},
"DeclarativePart": {
"node": {
"kind": "recurse_field",
"field": "f_decls"
},
"fields": {
"f_decls": {
"kind": "ifEmpty",
"then": "recurse",
"else": {
"kind": "group",
"document": [
"hardline",
"recurse"
]
}
}
}
},
"DefiningNameList": {
"sep": [
"recurse",
Expand Down Expand Up @@ -1226,7 +1245,6 @@
{
"kind": "indent",
"contents": [
"hardline",
{
"kind": "recurse_field",
"field": "f_public_part"
Expand Down Expand Up @@ -1256,7 +1274,6 @@
{
"kind": "indent",
"contents": [
"hardline",
"recurse"
]
},
Expand Down Expand Up @@ -1315,6 +1332,44 @@
]
}
},
"HandledStmts": {
"node": {
"kind": "group",
"break": true,
"document": [
{
"kind": "indent",
"contents": [
"hardline",
{
"kind": "recurse_field",
"field": "f_stmts"
}
]
},
{
"kind": "recurse_field",
"field": "f_exceptions"
}
]
},
"fields": {
"f_exceptions": [
"hardline",
{
"kind": "text",
"text": "exception"
},
{
"kind": "indent",
"contents": [
"hardline",
"recurse"
]
}
]
}
},
"IfStmt": {
"node": {
"kind": "group",
Expand Down Expand Up @@ -1712,7 +1767,6 @@
{
"kind": "indent",
"contents": [
"hardline",
{
"kind": "recurse_field",
"field": "f_decls"
Expand Down Expand Up @@ -1747,13 +1801,7 @@
]
},
"f_stmts": [
{
"kind": "indent",
"contents": [
"hardline",
"recurse"
]
},
"recurse",
"hardline"
]
}
Expand Down Expand Up @@ -1786,7 +1834,6 @@
{
"kind": "indent",
"contents": [
"hardline",
{
"kind": "recurse_field",
"field": "f_public_part"
Expand Down Expand Up @@ -1826,7 +1873,6 @@
{
"kind": "indent",
"contents": [
"hardline",
"recurse"
]
},
Expand Down Expand Up @@ -2258,14 +2304,8 @@
"text": "begin"
},
{
"kind": "indent",
"contents": [
"hardlineWithoutBreakParent",
{
"kind": "recurse_field",
"field": "f_stmts"
}
]
"kind": "recurse_field",
"field": "f_stmts"
},
"hardlineWithoutBreakParent",
{
Expand All @@ -2291,7 +2331,6 @@
{
"kind": "indent",
"contents": [
"hardlineWithoutBreakParent",
"recurse"
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": 32,
"id": 33,
"kind": "list",
"list": [
{
Expand Down Expand Up @@ -172,52 +172,62 @@
}
},
{
"id": 27,
"id": 28,
"kind": "command",
"command": {
"command": "indent",
"indentContents": {
"id": 26,
"kind": "list",
"list": [
{
"id": 24,
"id": 27,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 26,
"kind": "list",
"list": [
{
"id": 22,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": true
}
"id": 24,
"kind": "list",
"list": [
{
"id": 22,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": true
}
},
{
"id": 23,
"kind": "command",
"command": {
"command": "breakParent"
}
}
]
},
{
"id": 23,
"kind": "command",
"command": {
"command": "breakParent"
}
"id": 25,
"kind": "text",
"text": "type Corge;"
}
]
},
{
"id": 25,
"kind": "text",
"text": "type Corge;"
}
]
"break": true,
"expandedStates": null
}
}
}
},
{
"id": 30,
"id": 31,
"kind": "list",
"list": [
{
"id": 28,
"id": 29,
"kind": "command",
"command": {
"command": "line",
Expand All @@ -227,7 +237,7 @@
}
},
{
"id": 29,
"id": 30,
"kind": "command",
"command": {
"command": "breakParent"
Expand All @@ -236,7 +246,7 @@
]
},
{
"id": 31,
"id": 32,
"kind": "text",
"text": "end Foo;"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": 30,
"id": 31,
"kind": "list",
"list": [
{
Expand Down Expand Up @@ -157,52 +157,62 @@
}
},
{
"id": 25,
"id": 26,
"kind": "command",
"command": {
"command": "indent",
"indentContents": {
"id": 24,
"kind": "list",
"list": [
{
"id": 22,
"id": 25,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 24,
"kind": "list",
"list": [
{
"id": 20,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": true
}
"id": 22,
"kind": "list",
"list": [
{
"id": 20,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": true
}
},
{
"id": 21,
"kind": "command",
"command": {
"command": "breakParent"
}
}
]
},
{
"id": 21,
"kind": "command",
"command": {
"command": "breakParent"
}
"id": 23,
"kind": "text",
"text": "type Qux;"
}
]
},
{
"id": 23,
"kind": "text",
"text": "type Qux;"
}
]
"break": true,
"expandedStates": null
}
}
}
},
{
"id": 28,
"id": 29,
"kind": "list",
"list": [
{
"id": 26,
"id": 27,
"kind": "command",
"command": {
"command": "line",
Expand All @@ -212,7 +222,7 @@
}
},
{
"id": 27,
"id": 28,
"kind": "command",
"command": {
"command": "breakParent"
Expand All @@ -221,7 +231,7 @@
]
},
{
"id": 29,
"id": 30,
"kind": "text",
"text": "end Foo;"
}
Expand Down
Loading

0 comments on commit c27436c

Please sign in to comment.