[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [metalua] A bug to string escapes.
- From: Xavier Wang <weasley.wx@...>
- Date: Thu, 1 Dec 2011 10:59:30 +0800
Hi list :-)
I don't know it's the right place to report this bug, but I meet a
metalua lexer bug with string's escapes.
the metalua use two :gsub to turn string escapes to correct byte, but
a "\92" escape will confuse the lexer, the patch is below:
diff --git a/src/compiler/lexer.lua b/src/compiler/lexer.lua
index 8b19804..a5f7a9a 100644
--- a/src/compiler/lexer.lua
+++ b/src/compiler/lexer.lua
@@ -92,8 +92,8 @@ local function unescape_string (s)
end
return s
- :gsub ("(\\+)([0-9][0-9]?[0-9]?)", unesc_digits)
:gsub ("\\(%D)",unesc_letter)
+ :gsub ("(\\+)([0-9][0-9]?[0-9]?)", unesc_digits)
end
lexer.extractors = {
regards