766 Commits

Author SHA1 Message Date
Tor Andersson
ce69f95ff0 Treat BOM as whitespace. 2014-01-02 21:52:15 +01:00
Tor Andersson
bc914e674b Support line continuation escapes in string literals. 2014-01-02 14:00:31 +01:00
Sebastian Rasmussen
429d7cdce9 Fix typo so all arguments are loaded. 2013-12-30 22:58:43 +01:00
Tor Andersson
dde8db59b8 Add [no line-terminator here] context handling in lexer.
Return a semicolon if a newline is encountered following the
"break", "continue", "return" and "throw" keywords.

Add special tokens for ++ and -- with preceding line terminators,
so that they can be handled in the postfix expression grammar rules.
2013-12-28 17:39:47 +01:00
Tor Andersson
e928c1410c Set newline flag if a token is preceded by a line terminator. 2013-12-28 12:55:44 +01:00
Tor Andersson
42683b9b4a Minor cleanups. 2013-12-28 12:54:41 +01:00
Tor Andersson
a4e846ba53 Prepare lexer for hooking up to generated parser.
Use single character tokens as-is. Make token enums private in a
separate header file, and give them better names.
2013-12-27 23:54:45 +01:00
Tor Andersson
cb273846e4 Throw errors on future words immediately.
Use the latest ECMA 262-5 list of future words.
2013-12-27 18:31:17 +01:00
Tor Andersson
e01fe424ab Check hex string escapes so we don't read past the end of the string. 2013-12-27 18:31:17 +01:00
Tor Andersson
294a803552 Print error message with line number on lexical errors. 2013-12-27 15:54:35 +01:00
Sebastian Rasmussen
11730a96aa Free dynamically allocated yytext when closing. 2013-12-24 13:45:50 +01:00
Tor Andersson
e37029624d Lex regular expression literals. 2013-12-24 00:35:46 +01:00
Tor Andersson
db3ae4ed23 Move yytext and yynumber into js_State.
Make yytext dynamically allocated and grown.
2013-12-23 23:13:24 +01:00
Tor Andersson
f323d6a971 Clean up lexing macro use. 2013-12-23 22:54:14 +01:00
Sebastian Rasmussen
bb2279e43d Add lexer. 2013-12-23 19:53:34 +01:00
Tor Andersson
c816b1193e Create README files. 2013-12-23 19:45:43 +01:00