osa1 / language-lua

Lua parser and pretty-printer
BSD 3-Clause "New" or "Revised" License
51 stars 17 forks source link

Parse error in string with escapes #17

Closed nikomi closed 9 years ago

nikomi commented 9 years ago

Unfortunately language-lua currently fails to parse the file luaunit.lua with the following error:

lexical error near line: 418 col: 42: Cannot read string "\"\\\\\"\""

The offending line is

        return '"' .. string.gsub(v,'"', '\\"' ) .. '"'

and the offending string is the 2nd parameter to gsub: '\\"'.

Workaround: when the string is split into '\\' .. '"' parsing works as expected.

The original source file can be found here: https://github.com/bluebird75/luaunit

osa1 commented 9 years ago

Thanks for reporting. This should now be fixed. I'll address the other issue and then bump version number and upload to Hackage.

nikomi commented 9 years ago

Thanx for the quick response!

Am 19.02.2015 um 16:11 schrieb Ömer Sinan Ağacan notifications@github.com:

Thanks for reporting. This should now be fixed. I'll address the other issue and then bump version number and upload to Hackage.

— Reply to this email directly or view it on GitHub https://github.com/osa1/language-lua/issues/17#issuecomment-75067822.