Don't have keywords in the lexer and parser.
Instead of recognizing "function" as a keyword, simply match it as a context-sensitive keyword in the parser outside functions.
This commit is contained in:
5
filetests/parser/keywords.cton
Normal file
5
filetests/parser/keywords.cton
Normal file
@@ -0,0 +1,5 @@
|
||||
test cat
|
||||
|
||||
; 'function' is not a keyword, and can be used as the name of a function too.
|
||||
function function() {}
|
||||
; check: function function()
|
||||
Reference in New Issue
Block a user