Rhai identifiers are slightly different from Rust. For example, the first non-underscore character must be a letter and not a digit, so _0X is not allowed as an identifier.
Also, numbers cannot start with an underscore, so _10 is a syntax error. Otherwise it is too easy to confuse with -10.
A number's decimal point cannot be followed immediately by a _. Therefore, 10._1 is not allowed, but 10_.1 is OK.
NOTE: Your Rhai panel with the parse tree works wonders in finding out these issues.
Rhai identifiers are slightly different from Rust. For example, the first non-underscore character must be a letter and not a digit, so
_0X
is not allowed as an identifier.Also, numbers cannot start with an underscore, so
_10
is a syntax error. Otherwise it is too easy to confuse with-10
.A number's decimal point cannot be followed immediately by a
_
. Therefore,10._1
is not allowed, but10_.1
is OK.NOTE: Your Rhai panel with the parse tree works wonders in finding out these issues.