From baa51e934ce057af5b5be829d6a73a3e8b4c03d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 2 Feb 2020 11:19:39 +0100 Subject: lexers: also apply 7e9e0a2 to html and wsf lexers Adapt in_tag to surrounding coding stlye and use the same simplified version in html, wsf and xml lexers. --- lua/lexers/wsf.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lua/lexers/wsf.lua') diff --git a/lua/lexers/wsf.lua b/lua/lexers/wsf.lua index e00c363..37cb33e 100644 --- a/lua/lexers/wsf.lua +++ b/lua/lexers/wsf.lua @@ -20,13 +20,7 @@ local dq_str = l.delimited_range('"', false, true) local string = #S('\'"') * l.last_char_includes('=') * token(l.STRING, sq_str + dq_str) -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 and index or nil end - if s then return index end - return input:find('^[^<]->', index) and index or nil -end) +local in_tag = #P((1 - S'><')^0 * '>') -- Numbers. local number = #l.digit * l.last_char_includes('=') * -- cgit v1.2.3