From acaa57c6b6fca1531e7cb47b224207083c7ccd4b Mon Sep 17 00:00:00 2001 From: steve donovan Date: Fri, 8 Jul 2011 16:00:21 +0200 Subject: [PATCH] handling of strings was borked --- ldoc/lexer.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ldoc/lexer.lua b/ldoc/lexer.lua index 72bc167..b522243 100644 --- a/ldoc/lexer.lua +++ b/ldoc/lexer.lua @@ -44,9 +44,9 @@ local NUMBER4 = '^%d+%.?%d*[eE][%+%-]?%d+' local NUMBER5 = '^%d+%.?%d*' local IDEN = '^[%a_][%w_]*' local WSPACE = '^%s+' -local STRING1 = "^'.-[^\\]'" -local STRING2 = '^".-[^\\]"' -local STRING3 = '^[\'"][\'"]' +local STRING1 = [[^'.-[^\\]']] +local STRING2 = [[^".-[^\\]"]] +local STRING3 = "^((['\"])%2)" -- empty string local PREPRO = '^#.-[^\\]\n' local plain_matches,lua_matches,cpp_matches,lua_keyword,cpp_keyword @@ -306,14 +306,15 @@ function lexer.lua(s,filter,options) {STRING3,sdump}, {STRING1,sdump}, {STRING2,sdump}, + {'^%-%-%[%[.-%]%]',cdump}, {'^%-%-.-\n',cdump}, - {'^%[%[.+%]%]',sdump_l}, - {'^%-%-%[%[.+%]%]',cdump}, + {'^%[%[.-%]%]',sdump_l}, {'^==',tdump}, {'^~=',tdump}, {'^<=',tdump}, {'^>=',tdump}, {'^%.%.%.',tdump}, + {'^%.%.',tdump}, {'^.',tdump} } end