Skip to content

Commit

Permalink
Merge branch 'mku/dotted_name' into 'master'
Browse files Browse the repository at this point in the history
Unparsing : adding DottedName config

See merge request eng/libadalang/libadalang!1530
  • Loading branch information
CKMonika committed Feb 14, 2024
2 parents 059f34c + 50825a7 commit 303da69
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 63 deletions.
17 changes: 15 additions & 2 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
{
"node_configs": {
"DottedName": {
"node": {"kind": "fill", "document": "recurse"},
"node": {
"kind": "innerRoot",
"contents": {
"kind": "align",
"width": 2,
"contents": {"kind": "group", "document": "recurse"}
}
},
"fields": {
"f_prefix": ["recurse", "softline"]
"f_prefix": [
{
"kind": "recurse_flatten",
"if": ["DottedName"]
},
"softline"
]
}
}
}
Expand Down
61 changes: 0 additions & 61 deletions testsuite/tests/unparsing/dotted_name_0/doc-baseline.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"id": 8,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 7,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 6,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 5,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
},
{
"id": 1,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": true,
"hard": false
}
},
{
"id": 2,
"kind": "text",
"text": ".Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
},
{
"id": 3,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": true,
"hard": false
}
},
{
"id": 4,
"kind": "text",
"text": ".Ccccccccccccccccccccccccccccccc"
}
]
},
"break": false,
"expandedStates": null
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.Ccccccccccccccccccccccccccccccc
3 changes: 3 additions & 0 deletions testsuite/tests/unparsing/dotted_names/long_names/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
.Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
.Ccccccccccccccccccccccccccccccc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"id": 8,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 7,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 6,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 5,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "A"
},
{
"id": 1,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": true,
"hard": false
}
},
{
"id": 2,
"kind": "text",
"text": ".B"
},
{
"id": 3,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": true,
"hard": false
}
},
{
"id": 4,
"kind": "text",
"text": ".C"
}
]
},
"break": false,
"expandedStates": null
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions testsuite/tests/unparsing/dotted_names/short_names/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
driver: unparser
rule: expr

0 comments on commit 303da69

Please sign in to comment.