Corrected identifiers. Corrected lambda example.

This commit is contained in:
Jonathan Turner 2009-06-11 02:17:31 +00:00
parent d0ff0dc0f1
commit c20502cc81
2 changed files with 3 additions and 4 deletions

View File

@ -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))

View File

@ -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);