Corrected identifiers. Corrected lambda example.
This commit is contained in:
parent
d0ff0dc0f1
commit
c20502cc81
@ -1,3 +1,2 @@
|
||||
var add_them = function(x, y) { x + y }
|
||||
//print(add_them(3, 4))
|
||||
print(7)
|
||||
var add2 = function(x, y) { x + y }
|
||||
print(add2(3, 4))
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
lexer.set_multiline_comment(Pattern("/\\*", TokenType::Comment), Pattern("\\*/", TokenType::Comment));
|
||||
lexer.set_singleline_comment(Pattern("//", TokenType::Comment));
|
||||
|
||||
lexer << Pattern("[A-Za-z_]+", TokenType::Identifier);
|
||||
lexer << Pattern("[A-Za-z_][A-Za-z_0-9]*", TokenType::Identifier);
|
||||
lexer << Pattern("[0-9]+\\.[0-9]+", TokenType::Real_Number);
|
||||
lexer << Pattern("[0-9]+", TokenType::Integer);
|
||||
lexer << Pattern("[!@#$%^&*|\\-+=<>.]+|/[!@#$%^&|\\-+=<>]*", TokenType::Operator);
|
||||
|
Loading…
x
Reference in New Issue
Block a user