AST: Allow KCL fn params to have defaults and labels (#4676)

Pure refactor, should not change any behaviour.

Previously, optional parameters in KCL function calls always set the parameter to KclNone. 

As of this PR, they can be set to KCL literals in addition to KCL none. However the parser does not actually ever use this (that'll be in a follow-up PR).

Also adds a `labeled: bool` to all parameters, which is always true. But it lays the groundwork for the unlabeled first parameter in a follow-up PR.
This commit is contained in:
Adam Chalmers
2024-12-05 21:04:40 -06:00
committed by GitHub
parent eb96d6539c
commit 9e57034873
35 changed files with 240 additions and 200 deletions

View File

@ -1236,8 +1236,7 @@ snapshot_kind: text
"name": "x",
"start": 1207,
"type": "Identifier"
},
"optional": false
}
},
{
"type": "Parameter",
@ -1246,8 +1245,7 @@ snapshot_kind: text
"name": "y",
"start": 1210,
"type": "Identifier"
},
"optional": false
}
},
{
"type": "Parameter",
@ -1256,8 +1254,7 @@ snapshot_kind: text
"name": "height",
"start": 1213,
"type": "Identifier"
},
"optional": false
}
}
],
"start": 1206,