Commit Graph

1 Commits

Author SHA1 Message Date
Bob Nystrom
cc55fd2a57 feat: implement string escape sequence parsing in lexer and add test coverage
Add escape sequence handling to the string literal lexer in compiler.c, translating
common escape sequences (\", \\, \n) into their literal character equivalents during
tokenization. Introduce a fixed-size buffer (MAX_STRING 1024) in the Parser struct to
accumulate the unescaped string content, along with a helper function addStringChar()
to append characters. The readString() function now loops over input characters,
breaking on an unescaped double quote, and processing backslash-prefixed escapes via
a switch statement. Remove the previous TODO placeholder comment and the elapsed time
computation simplification in benchmark/fib.lua. Add a new test file
test/string_escapes.wren that verifies the three supported escape sequences, and
remove the now-obsolete TODO about escapes from test/string_literals.wren.
2013-11-24 05:00:47 +00:00