From fd6c1f68883a76c9d4b3e49f492fa9c09370eede Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 15 May 2014 15:56:51 +0100 Subject: [PATCH] elua: comment is a valid token in xgettext --- src/bin/elua/modules/xgettext/lexer.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/elua/modules/xgettext/lexer.lua b/src/bin/elua/modules/xgettext/lexer.lua index ed065c3b2c..5af0f34221 100644 --- a/src/bin/elua/modules/xgettext/lexer.lua +++ b/src/bin/elua/modules/xgettext/lexer.lua @@ -99,16 +99,16 @@ local read_long_string = function(ls, sep, cmt) if skip_sep(ls, tbuf) == sep then c = next_char(ls) break - elseif not cmt then + else buf[#buf + 1] = tconc(tbuf) end c = ls.current else - if not cmt then buf[#buf + 1] = c end + buf[#buf + 1] = c c = next_char(ls) end end - if not cmt then return tconc(buf) end + return tconc(buf) end local read_string = function(ls) @@ -145,13 +145,15 @@ local lex_tbl = { if c == "[" then local sep = skip_sep(ls, {}) if sep >= 0 then - read_long_string(ls, sep, true) - return + return "", read_long_string(ls, sep, true) end end + local buf = {} while ls.current and ls.current ~= "\n" and ls.current ~= "\r" do + buf[#buf + 1] = ls.current next_char(ls) end + return "", tconc(buf) end, ["[" ] = function(ls) local buf = {}