aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/wsf.lua
diff options
context:
space:
mode:
authororbitalquark <70453897+orbitalquark@users.noreply.github.com>2024-09-18 14:30:49 -0400
committerRandy Palamar <randy@rnpnr.xyz>2025-01-04 12:29:07 -0700
commitc1f4d3f68787fa2ae964c468d28a84df37319b28 (patch)
treedcd62bd74f8f9fd786cba6a0c248fb388d5244a8 /lua/lexers/wsf.lua
parentcc18cea14d1f836abcebb84a96f5029431474255 (diff)
downloadvis-c1f4d3f68787fa2ae964c468d28a84df37319b28.tar.gz
vis-c1f4d3f68787fa2ae964c468d28a84df37319b28.tar.xz
lexers: switch to tabs for indentation
Diffstat (limited to 'lua/lexers/wsf.lua')
-rw-r--r--lua/lexers/wsf.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/lua/lexers/wsf.lua b/lua/lexers/wsf.lua
index cbfa221..e95802b 100644
--- a/lua/lexers/wsf.lua
+++ b/lua/lexers/wsf.lua
@@ -22,11 +22,11 @@ lex:add_rule('tag_close', tag_close)
-- 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
@@ -49,7 +49,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)
@@ -68,7 +68,7 @@ local embed_end_tag = tag * tag_close
-- Embedded JavaScript.
local js = lexer.load('javascript')
local js_start_rule = #(P('<script') * (P(function(input, index)
- if input:find('^%s+language%s*=%s*(["\'])[jJ][ava]*[sS]cript%1', index) then return true end
+ if input:find('^%s+language%s*=%s*(["\'])[jJ][ava]*[sS]cript%1', index) then return true end
end) + '>')) * embed_start_tag -- <script language="javascript">
local js_end_rule = #P('</script>') * embed_end_tag -- </script>
lex:embed(js, js_start_rule, js_end_rule)
@@ -76,7 +76,7 @@ lex:embed(js, js_start_rule, js_end_rule)
-- Embedded VBScript.
local vbs = lexer.load('vb', 'vbscript')
local vbs_start_rule = #(P('<script') * (P(function(input, index)
- if input:find('^%s+language%s*=%s*(["\'])[vV][bB][sS]cript%1', index) then return true end
+ if input:find('^%s+language%s*=%s*(["\'])[vV][bB][sS]cript%1', index) then return true end
end) + '>')) * embed_start_tag -- <script language="vbscript">
local vbs_end_rule = #P('</script>') * embed_end_tag -- </script>
lex:embed(vbs, vbs_start_rule, vbs_end_rule)