feat: add null literal token and compiler support with keyword parsing and test cases
Introduce TOKEN_NULL to the token enum and register it as a prefix parse rule that emits CODE_NULL. Implement the null() compiler function to emit the null constant. Extend readName() to recognize the "null" keyword and map it to TOKEN_NULL. Add test files verifying null output, and that null, true, and false cannot be used as variable names.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
var false = "value" // expect error
|
||||
@@ -0,0 +1 @@
|
||||
var null = "value" // expect error
|
||||
@@ -0,0 +1 @@
|
||||
var true = "value" // expect error
|
||||
@@ -0,0 +1 @@
|
||||
io.write(null) // expect: null
|
||||
Reference in New Issue
Block a user