Skip to content

Commit

Permalink
Merge branch 'mku/MR_contract_cases' into 'master'
Browse files Browse the repository at this point in the history
Unparsing: Add ContractCases, ContractCaseAssoc and ContractCaseAssocList configs

Closes #1368

See merge request eng/libadalang/libadalang!1628
  • Loading branch information
CKMonika committed Apr 17, 2024
2 parents 2807442 + 8386066 commit 5e102bc
Show file tree
Hide file tree
Showing 15 changed files with 1,737 additions and 10 deletions.
70 changes: 66 additions & 4 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,13 @@
{
"kind": "align",
"width": 2,
"contents": {
"kind": "recurse_field",
"field": "f_expr"
}
"contents": [
"line",
{
"kind": "recurse_field",
"field": "f_expr"
}
]
},
{
"kind": "text",
Expand Down Expand Up @@ -1106,6 +1109,65 @@
"line"
]
},
"ContractCases": {
"node": {
"kind": "group",
"document": {
"kind": "align",
"width": 1,
"contents": [
{
"kind": "text",
"text": "("
},
{
"kind": "innerRoot",
"contents": {
"kind": "recurse_field",
"field": "f_contract_cases"
}
},
{
"kind": "text",
"text": ")"
}
]
}
}
},
"ContractCaseAssoc": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_guard"
},
"whitespace",
{
"kind": "text",
"text": "=>"
},
{
"kind": "align",
"width": 2,
"contents": [
"line",
{
"kind": "recurse_field",
"field": "f_consequence"
}
]
}
]
}
},
"ContractCaseAssocList": {
"sep": [
"recurse",
"line"
]
},
"ConcreteFormalSubpDecl": {
"node": {
"kind": "align",
Expand Down
22 changes: 16 additions & 6 deletions testsuite/tests/unparsing/attribute_def_clause/doc-baseline.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"id": 10,
"id": 11,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 9,
"id": 10,
"kind": "list",
"list": [
{
Expand Down Expand Up @@ -40,7 +40,7 @@
"text": " use"
},
{
"id": 7,
"id": 8,
"kind": "command",
"command": {
"command": "align",
Expand All @@ -49,20 +49,30 @@
"n": 2
},
"alignContents": {
"id": 6,
"id": 7,
"kind": "list",
"list": [
{
"id": 5,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 6,
"kind": "text",
"text": " 16"
"text": "16"
}
]
}
}
},
{
"id": 8,
"id": 9,
"kind": "text",
"text": ";"
}
Expand Down
Loading

0 comments on commit 5e102bc

Please sign in to comment.