From 0095750ce4843442d9710e09827e2a9b6a11e9bd Mon Sep 17 00:00:00 2001 From: Fabien Fleutot Date: Sat, 13 Sep 2008 10:53:11 +0200 Subject: [PATCH] literal parsing bug --- src/compiler/lexer.lua | 4 ++-- src/compiler/mlc.mlua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/lexer.lua b/src/compiler/lexer.lua index 6815011..f066d09 100644 --- a/src/compiler/lexer.lua +++ b/src/compiler/lexer.lua @@ -52,7 +52,7 @@ lexer.patterns = { long_string = "^%[(=*)%[\n?(.-)%]%1%]()", number_mantissa = { "^%d+%.?%d*()", - "^%d*%d%.%d+()" }, + "^%d*%.%d+()" }, number_exponant = "^[eE][%+%-]?%d+()", number_hex = "^0[xX]%x+()", word = "^([%a_][%w_]*)()" @@ -84,7 +84,7 @@ local function unescape_string (s) return s :gsub ("\\(%D)",unesc_letter) - :gsub ("\\([0-9]+)", unesc_digits) + :gsub ("\\([0-9][0-9]?[0-9]?)", unesc_digits) end lexer.extractors = { diff --git a/src/compiler/mlc.mlua b/src/compiler/mlc.mlua index 7dcfae6..d317f0c 100644 --- a/src/compiler/mlc.mlua +++ b/src/compiler/mlc.mlua @@ -102,7 +102,7 @@ function mlc.convert (x, src_fmt, dst_fmt, name) if not status and x then -- x = error msg; get rid of ??? x = x:strmatch "[^:]+:[0-9]+: (.*)" or x - local li = lx:lineinfo() + local li = lx:lineinfo_left() error(string.format("Parsing error in %s line %s, column %i, char %s: \n%s", name or "", li[1], li[2], li[3], x)) return nil -- 2.11.4.GIT