Skip to content

Commit

Permalink
Merge branch 'issue_1289' into 'master'
Browse files Browse the repository at this point in the history
Unparsing: add ParamSpec and related nodes configs

Closes #1289

See merge request eng/libadalang/libadalang!1551
  • Loading branch information
joaopsazevedo committed Feb 23, 2024
2 parents 9953a43 + 1050986 commit d7351d0
Show file tree
Hide file tree
Showing 25 changed files with 1,505 additions and 101 deletions.
387 changes: 286 additions & 101 deletions extensions/default_unparsing_config.json

Large diffs are not rendered by default.

202 changes: 202 additions & 0 deletions testsuite/tests/unparsing/param_spec/everything_long/doc-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
{
"id": 25,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 24,
"kind": "list",
"list": [
{
"id": 10,
"kind": "command",
"command": {
"command": "group",
"id": 1,
"groupContents": {
"id": 9,
"kind": "list",
"list": [
{
"id": 1,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 0,
"kind": "text",
"text": "Fooooooooooooooooo"
},
"break": false,
"expandedStates": null
}
},
{
"id": 2,
"kind": "text",
"text": " :"
},
{
"id": 8,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 7,
"kind": "list",
"list": [
{
"id": 3,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 6,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 5,
"kind": "list",
"list": [
{
"id": 4,
"kind": "text",
"text": "aliased in out not null access Baaaaaaaaaaaaaaaaaaaaaaar"
}
]
},
"break": false,
"expandedStates": null
}
}
]
}
}
}
]
},
"break": false,
"expandedStates": null
}
},
{
"id": 23,
"kind": "command",
"command": {
"command": "ifBreak",
"ifBreakGroupId": 1,
"breakContents": {
"id": 22,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 4
},
"alignContents": {
"id": 21,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 20,
"kind": "list",
"list": [
{
"id": 17,
"kind": "text",
"text": " :="
},
{
"id": 18,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 19,
"kind": "text",
"text": "Baaaaaaaaaaaaaaaaz"
}
]
},
"break": false,
"expandedStates": null
}
}
}
},
"flatContents": {
"id": 16,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 15,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 14,
"kind": "list",
"list": [
{
"id": 11,
"kind": "text",
"text": " :="
},
{
"id": 12,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 13,
"kind": "text",
"text": "Baaaaaaaaaaaaaaaaz"
}
]
},
"break": false,
"expandedStates": null
}
}
}
}
}
}
]
},
"break": false,
"expandedStates": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fooooooooooooooooo : aliased in out not null access Baaaaaaaaaaaaaaaaaaaaaaar := Baaaaaaaaaaaaaaaaz
3 changes: 3 additions & 0 deletions testsuite/tests/unparsing/param_spec/everything_long/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fooooooooooooooooo :
aliased in out not null access Baaaaaaaaaaaaaaaaaaaaaaar :=
Baaaaaaaaaaaaaaaaz
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
driver: unparser
rule: param_spec
description: |
Test that when everything is long (ids, type expression and default
expression), line breaks and continuam line indentation are added after the
`:` and `:=`.
Loading

0 comments on commit d7351d0

Please sign in to comment.