aboutsummaryrefslogtreecommitdiff
path: root/lexers/lexer.lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-10-07 07:31:21 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-10-07 07:42:51 +0200
commit4e8e356e94533cc2d47aec804cdc86dbb0fca530 (patch)
tree3e69ac1ad2b4f3e0a3f635d5b2eedb95200e8761 /lexers/lexer.lua
parentca0ce4631c2474088f4ee0943d45397460fec3a7 (diff)
downloadvis-4e8e356e94533cc2d47aec804cdc86dbb0fca530.tar.gz
vis-4e8e356e94533cc2d47aec804cdc86dbb0fca530.tar.xz
lexers: sync with scintillua changeset 571 rev 23435f1d82da
This fixes ":set syntax text" and adds a missing file association for the taskpaper lexer. The protobuf and crystal lexers were slightly reformatted, but should contain no functional changes.
Diffstat (limited to 'lexers/lexer.lua')
-rw-r--r--lexers/lexer.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/lexers/lexer.lua b/lexers/lexer.lua
index bce9c29..5653bb2 100644
--- a/lexers/lexer.lua
+++ b/lexers/lexer.lua
@@ -1032,9 +1032,7 @@ function M.load(name, alt_name)
-- prevent errors from occurring.
if not M.property then
M.property, M.property_int = {}, setmetatable({}, {
- __index = function(t, k)
- return tostring(tonumber(M.property[k]) or 0)
- end,
+ __index = function(t, k) return tonumber(M.property[k]) or 0 end,
__newindex = function() error('read-only property') end
})
end
@@ -1114,6 +1112,7 @@ end
-- @return table of token names and positions.
-- @name lex
function M.lex(lexer, text, init_style)
+ if not lexer._GRAMMAR then return {M.DEFAULT, #text + 1} end
if not lexer._LEXBYLINE then
-- For multilang lexers, build a new grammar whose initial_rule is the
-- current language.