diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-02-02 11:19:39 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-02-02 11:19:39 +0100 |
| commit | baa51e934ce057af5b5be829d6a73a3e8b4c03d0 (patch) | |
| tree | d194774b5342ecb444557cda0babefe708f96ffa /lua/lexers/wsf.lua | |
| parent | 7e9e0a2ca868aaa214fb38a79fe71da34d6e00da (diff) | |
| download | vis-baa51e934ce057af5b5be829d6a73a3e8b4c03d0.tar.gz vis-baa51e934ce057af5b5be829d6a73a3e8b4c03d0.tar.xz | |
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.
Diffstat (limited to 'lua/lexers/wsf.lua')
| -rw-r--r-- | lua/lexers/wsf.lua | 8 |
1 files changed, 1 insertions, 7 deletions
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('=') * |
