From c1f4d3f68787fa2ae964c468d28a84df37319b28 Mon Sep 17 00:00:00 2001 From: orbitalquark <70453897+orbitalquark@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:30:49 -0400 Subject: lexers: switch to tabs for indentation --- lua/lexers/xml.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lua/lexers/xml.lua') diff --git a/lua/lexers/xml.lua b/lua/lexers/xml.lua index 0e33f6a..a3c4f97 100644 --- a/lua/lexers/xml.lua +++ b/lua/lexers/xml.lua @@ -14,8 +14,8 @@ lex:add_rule('cdata', lex:tag('cdata', lexer.range(''))) local ws = lex:get_rule('whitespace') local identifier = (lexer.alpha + S('_-')) * (lexer.alnum + S('_-'))^0 local doctype = lex:tag(lexer.TAG .. '.doctype', ''))^0 * - lex:tag(lexer.TAG .. '.doctype', '>') + lex:tag(lexer.TAG .. '.doctype', identifier) * (ws * identifier)^-1 * (1 - P('>'))^0 * + lex:tag(lexer.TAG .. '.doctype', '>') lex:add_rule('doctype', doctype) -- Processing instructions. @@ -31,11 +31,11 @@ lex:add_rule('close_tag', lex:tag(lexer.TAG, P('/')^-1 * '>')) -- Equals. -- TODO: performance is terrible on large files. local in_tag = P(function(input, index) - local before = input:sub(1, index - 1) - local s, e = before:find('<[^>]-$'), before:find('>[^<]-$') - if s and e then return s > e end - if s then return true end - return input:find('^[^<]->', index) ~= nil + local before = input:sub(1, index - 1) + local s, e = before:find('<[^>]-$'), before:find('>[^<]-$') + if s and e then return s > e end + if s then return true end + return input:find('^[^<]->', index) ~= nil end) local equals = lex:tag(lexer.OPERATOR, '=') -- * in_tag @@ -56,7 +56,7 @@ lex:add_rule('number', lexer.after_set('=', number)) -- *in_tag) -- Entities. local predefined = lex:tag(lexer.CONSTANT_BUILTIN .. '.entity', - '&' * lexer.word_match('lt gt amp apos quot') * ';') + '&' * lexer.word_match('lt gt amp apos quot') * ';') local general = lex:tag(lexer.CONSTANT .. '.entity', '&' * identifier * ';') lex:add_rule('entity', predefined + general) @@ -70,6 +70,6 @@ lex:add_fold_point('cdata', '') lexer.property['scintillua.comment'] = '' lexer.property['scintillua.angle.braces'] = '1' lexer.property['scintillua.word.chars'] = - 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-' + 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-' return lex -- cgit v1.2.3