feat: add bitwise NOT operator (~) with token, parser, and native implementation
Add TOKEN_TILDE token type and lexer support for the '~' character in the compiler. Implement the bitwise NOT operation as a native method on the Num class, operating on 32-bit unsigned integers. Include a new OPERATOR macro for prefix/infix operator grammar rules and add comprehensive test cases covering positive, negative, floating-point, and boundary values.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
var a = "a"
|
||||
var b = "b"
|
||||
var c = "c"
|
||||
|
||||
// Assignment is right-associative.
|
||||
a = b = c
|
||||
io.write(a) // expect: c
|
||||
io.write(b) // expect: c
|
||||
io.write(c) // expect: c
|
||||
Reference in New Issue
Block a user