From 4e8e356e94533cc2d47aec804cdc86dbb0fca530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 7 Oct 2016 07:31:21 +0200 Subject: 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. --- lexers/lexer.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lexers/lexer.lua') 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. -- cgit v1.2.3