Skip to content

Commit

Permalink
Merge branch 'issue_1312' into 'master'
Browse files Browse the repository at this point in the history
Unparsing: add configurations for ForLoopStmt, WhileLoopStmt and LoopStmt

Closes #1312

See merge request eng/libadalang/libadalang!1580
  • Loading branch information
joaopsazevedo committed Mar 20, 2024
2 parents 65cf86d + 31fed18 commit c950b72
Show file tree
Hide file tree
Showing 29 changed files with 2,127 additions and 0 deletions.
215 changes: 215 additions & 0 deletions extensions/default_unparsing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,112 @@
"document": "recurse"
}
},
"ForLoopIterFilter": {
"node": {
"kind": "group",
"document": [
{
"kind": "text",
"text": "when"
},
"whitespace",
{
"kind": "recurse_field",
"field": "f_expr"
}
]
}
},
"ForLoopSpec": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_var_decl"
},
{
"kind": "align",
"width": 2,
"contents": [
"line",
{
"kind": "recurse_field",
"field": "f_loop_type"
},
{
"kind": "recurse_field",
"field": "f_has_reverse"
},
"whitespace",
{
"kind": "recurse_field",
"field": "f_iter_expr"
},
"line",
{
"kind": "recurse_field",
"field": "f_iter_filter"
}
]
}
]
}
},
"ForLoopStmt": {
"node": {
"kind": "group",
"document": [
{
"kind": "group",
"document": [
{
"kind": "text",
"text": "for"
},
"whitespace",
{
"kind": "recurse_field",
"field": "f_spec"
},
"line",
{
"kind": "text",
"text": "loop"
}
]
},
{
"kind": "indent",
"contents": [
"hardline",
{
"kind": "recurse_field",
"field": "f_stmts"
}
]
},
"hardline",
{
"kind": "text",
"text": "end"
},
"whitespace",
{
"kind": "text",
"text": "loop"
},
{
"kind": "recurse_field",
"field": "f_end_name"
},
{
"kind": "text",
"text": ";"
}
]
}
},
"GenericFormalPart": {
"node": {
"kind": "group",
Expand Down Expand Up @@ -1741,6 +1847,49 @@
]
}
},
"LoopStmt": {
"node": {
"kind": "group",
"document": [
{
"kind": "recurse_field",
"field": "f_spec"
},
{
"kind": "text",
"text": "loop"
},
{
"kind": "indent",
"contents": [
"hardline",
{
"kind": "recurse_field",
"field": "f_stmts"
}
]
},
"hardline",
{
"kind": "text",
"text": "end"
},
"whitespace",
{
"kind": "text",
"text": "loop"
},
{
"kind": "recurse_field",
"field": "f_end_name"
},
{
"kind": "text",
"text": ";"
}
]
}
},
"NameList": {
"sep": [
"recurse",
Expand Down Expand Up @@ -2920,6 +3069,72 @@
}
]
},
"WhileLoopSpec": {
"node": [
{
"kind": "text",
"text": "while"
},
"whitespace",
{
"kind": "recurse_field",
"field": "f_expr"
}
]
},
"WhileLoopStmt": {
"node": {
"kind": "group",
"document": [
{
"kind": "group",
"document": [
{
"kind": "align",
"width": 2,
"contents": {
"kind": "recurse_field",
"field": "f_spec"
}
},
"line",
{
"kind": "text",
"text": "loop"
}
]
},
{
"kind": "indent",
"contents": [
"hardline",
{
"kind": "recurse_field",
"field": "f_stmts"
}
]
},
"hardline",
{
"kind": "text",
"text": "end"
},
"whitespace",
{
"kind": "text",
"text": "loop"
},
{
"kind": "recurse_field",
"field": "f_end_name"
},
{
"kind": "text",
"text": ";"
}
]
}
},
"WithClause": {
"node": {
"kind": "group",
Expand Down
Loading

0 comments on commit c950b72

Please sign in to comment.