UPDATE: Adds name validation and exposes it in wasm

We do a trick I am not proud of. Because all of our errors are Strings,
we don't have a way to separate a name error from an index error,
for instance. What I do in prepend the error with a string that indicates
where it comes from.
This commit is contained in:
Nicolás Hatcher
2025-11-17 19:57:18 +01:00
committed by Nicolás Hatcher Andrés
parent 3db094c956
commit 1391f196b5
7 changed files with 108 additions and 49 deletions

View File

@@ -196,6 +196,7 @@ fn test_names() {
assert!(is_valid_identifier("_."));
assert!(is_valid_identifier("_1"));
assert!(is_valid_identifier("\\."));
assert!(is_valid_identifier("truñe"));
// invalid
assert!(!is_valid_identifier("true"));
@@ -209,7 +210,6 @@ fn test_names() {
assert!(!is_valid_identifier("1true"));
assert!(!is_valid_identifier("test€"));
assert!(!is_valid_identifier("truñe"));
assert!(!is_valid_identifier("tr&ue"));
assert!(!is_valid_identifier("LOG10"));