Skip to content

Commit

Permalink
Merge branch 'issue_1256' into 'master'
Browse files Browse the repository at this point in the history
Unparsing: add ElsifStmtPart and IfStmt configs

Closes #1256

See merge request eng/libadalang/libadalang!1545
  • Loading branch information
joaopsazevedo committed Feb 21, 2024
2 parents db084e1 + 2382f78 commit 64f6230
Show file tree
Hide file tree
Showing 17 changed files with 1,349 additions and 14 deletions.
156 changes: 142 additions & 14 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
{
"kind": "text",
"text": "is"
},
},
"line",
{
"kind": "recurse_field",
Expand All @@ -195,7 +195,7 @@
}
]
}
}
}
},
"DecimalFixedPointDef":{
"node": {
Expand All @@ -205,7 +205,7 @@
"kind": "text",
"text": "delta"
},
"whitespace",
"whitespace",
{
"kind": "recurse_field",
"field": "f_delta"
Expand All @@ -215,7 +215,7 @@
"kind": "text",
"text": "digits"
},
"whitespace",
"whitespace",
{
"kind": "recurse_field",
"field": "f_digits"
Expand All @@ -233,9 +233,9 @@
"kind": "innerRoot",
"contents": "recurse"
}
]
]
}
},
},
"DottedName": {
"node": {
"kind": "innerRoot",
Expand Down Expand Up @@ -282,7 +282,57 @@
"text": ")"
}
]
}
}
},
"ElsifStmtPart": {
"node": {
"kind": "group",
"document": [
{
"kind": "group",
"document": [
{
"kind": "text",
"text": "elsif"
},
"whitespace",
{
"kind": "align",
"width": 2,
"contents": {
"kind": "group",
"document": {
"kind": "recurse_field",
"field": "f_cond_expr"
}
}
},
"line",
{
"kind": "text",
"text": "then"
}
]
},
{
"kind": "indent",
"contents": [
"hardlineWithoutBreakParent",
{
"kind": "recurse_field",
"field": "f_stmts"
}
]
},
"hardlineWithoutBreakParent"
]
}
},
"ElsifExprPartList": {
"sep": [
"recurse",
"hardlineWithoutBreakParent"
]
},
"FloatingPointDef":{
"node": {
Expand All @@ -292,7 +342,7 @@
"kind": "text",
"text": "digits"
},
"whitespace",
"whitespace",
{
"kind": "recurse_field",
"field": "f_num_digits"
Expand All @@ -310,8 +360,86 @@
"kind": "innerRoot",
"contents": "recurse"
}
]
}
]
}
},
"IfStmt": {
"node": {
"kind": "group",
"document": [
{
"kind": "group",
"document": [
{
"kind": "text",
"text": "if"
},
"whitespace",
{
"kind": "align",
"width": 2,
"contents": {
"kind": "recurse_field",
"field": "f_cond_expr"
}
},
"line",
{
"kind": "text",
"text": "then"
}
]
},
{
"kind": "indent",
"contents": [
"hardlineWithoutBreakParent",
{
"kind": "recurse_field",
"field": "f_then_stmts"
}
]
},
"hardlineWithoutBreakParent",
{
"kind": "recurse_field",
"field": "f_alternatives"
},
{
"kind": "recurse_field",
"field": "f_else_stmts"
},
{
"kind": "text",
"text": "end"
},
"whitespace",
{
"kind": "text",
"text": "if"
},
{
"kind": "text",
"text": ";"
}
]
},
"fields": {
"f_alternatives": {
"kind": "group",
"document": "recurse"
},
"f_else_stmts": [
{
"kind": "indent",
"contents": [
"hardlineWithoutBreakParent",
"recurse"
]
},
"hardlineWithoutBreakParent"
]
}
},
"NameList":{
"sep":["recurse", "line"]
Expand All @@ -324,7 +452,7 @@
"kind": "text",
"text": "delta"
},
"whitespace",
"whitespace",
{
"kind": "recurse_field",
"field": "f_delta"
Expand All @@ -338,7 +466,7 @@
}
}
]
}
}
},
"PackageBody": {
"node": [
Expand Down Expand Up @@ -532,7 +660,7 @@
}
]
}
}
}
},
"ReturnStmt": {
"node": {
Expand All @@ -554,7 +682,7 @@
"node": {
"kind": "recurse_field",
"field": "f_range"
}
}
},
"UsePackageClause": {
"node": {
Expand Down
Loading

0 comments on commit 64f6230

Please sign in to comment.