4 ms·
Mostly, agreed. Here is the lexer for Lua: http://www.lua.org/source/5.1/llex.c.html http://www.lua.org/source/5.1/llex.c.html It's 382 lines of ANSI C accord
by pkaler 17y ago
Mostly, agreed. Here is the lexer for Lua: http://www.lua.org/source/5.1/llex.c.html http://www.lua.org/source/5.1/llex.c.html
It's 382 lines of ANSI C according to sloccount. Reading the array at the top of the file, there are about 30 tokens in Lua. So, you are probably going to write at least 30 test cases.
Writing that in less than an hour is being generous. But, it should be doable in a day.