Compare commits

...

1 Commits

Author SHA1 Message Date
76804a9f0a Remove serde tags on structs 2023-11-09 13:43:31 -06:00
3 changed files with 41 additions and 2 deletions

View File

@ -1124,7 +1124,6 @@ impl PartialEq for Function {
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
#[ts(export)]
#[serde(tag = "type")]
pub struct VariableDeclaration {
pub start: usize,
pub end: usize,
@ -1347,7 +1346,6 @@ impl VariableDeclarator {
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
#[ts(export)]
#[serde(tag = "type")]
pub struct Literal {
pub start: usize,
pub end: usize,

View File

@ -2801,4 +2801,5 @@ mod snapshot_tests {
snapshot_test!(ar, r#"5 + "a""#);
snapshot_test!(at, "line([0, l], %)");
snapshot_test!(au, include_str!("../../../tests/executor/inputs/cylinder.kcl"));
snapshot_test!(av, "const x = 3");
}

View File

@ -0,0 +1,40 @@
---
source: kcl/src/parser/parser_impl.rs
expression: actual
---
{
"start": 0,
"end": 11,
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 11,
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 11,
"id": {
"type": "Identifier",
"start": 6,
"end": 7,
"name": "x"
},
"init": {
"type": "Literal",
"start": 10,
"end": 11,
"value": 3,
"raw": "3"
}
}
],
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": []
}
}