BREAKING: Change to disallow indexing KCL records/objects with strings (#6529)

* Change to disallow indexing records/objects with strings

* Update output

* Remove outdated sim test

* Fix tests
This commit is contained in:
Jonathan Tran
2025-04-28 12:08:47 -04:00
committed by GitHub
parent 719136937e
commit 2e754f2a11
26 changed files with 297 additions and 1633 deletions

View File

@ -1515,44 +1515,6 @@ const fnBox = box(3, 6, 10)"#;
return myBox
}
const thisBox = box({start: [0,0], l: 6, w: 10, h: 3})
"#;
parse_execute(ast).await.unwrap();
}
#[tokio::test(flavor = "multi_thread")]
async fn test_get_member_of_object_with_function_brace() {
let ast = r#"fn box = (obj) => {
let myBox = startSketchOn(XY)
|> startProfile(at = obj["start"])
|> line(end = [0, obj["l"]])
|> line(end = [obj["w"], 0])
|> line(end = [0, -obj["l"]])
|> close()
|> extrude(length = obj["h"])
return myBox
}
const thisBox = box({start: [0,0], l: 6, w: 10, h: 3})
"#;
parse_execute(ast).await.unwrap();
}
#[tokio::test(flavor = "multi_thread")]
async fn test_get_member_of_object_with_function_mix_period_brace() {
let ast = r#"fn box = (obj) => {
let myBox = startSketchOn(XY)
|> startProfile(at = obj["start"])
|> line(end = [0, obj["l"]])
|> line(end = [obj["w"], 0])
|> line(end = [10 - obj["w"], -obj.l])
|> close()
|> extrude(length = obj["h"])
return myBox
}
const thisBox = box({start: [0,0], l: 6, w: 10, h: 3})
"#;
parse_execute(ast).await.unwrap();