Added support for compile-time constant hash expressions

This commit is contained in:
2025-12-05 21:34:51 -07:00
parent 93b5f28ccb
commit 9993bff574
10 changed files with 150 additions and 21 deletions

View File

@@ -146,3 +146,25 @@ fn test_boolean_return() -> anyhow::Result<()> {
Ok(())
}
#[test]
fn test_const_hash_expr() -> anyhow::Result<()> {
let compiled = compile!(debug r#"
const nameHash = hash("AccessCard");
device self = "db";
self.Setting = nameHash;
"#);
assert_eq!(
compiled,
indoc! {
"
j main
main:
s db Setting -732925934
"
}
);
Ok(())
}