aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/lexer.lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-02-25 20:48:51 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-02-25 21:14:28 +0100
commit3751586e1fbf044fa798737e9c59a0235c5aaee7 (patch)
tree417e30516500092e4002d3a6c2dacdd6b3050d90 /lua/lexers/lexer.lua
parentb44f174cccd4cd2b1b975f2767335ce636ee273b (diff)
downloadvis-3751586e1fbf044fa798737e9c59a0235c5aaee7.tar.gz
vis-3751586e1fbf044fa798737e9c59a0235c5aaee7.tar.xz
lexers: sync with scintillua changeset 594 rev 6e29a8d2a783
Stuff which was left out / our local changes include: - lexer.lua: different loading mechanism and style handling - ansi_c.lua: for now we keep the separate token definitions with references to the respective standards. This should highlight file names after #include directives. It will also treat simple, non-nested occurrences of #if 0 ... #endif as a comment. - pkgbuild.lua: the arch specific fields have been kept - all scintilla $(style variables) have been replaced
Diffstat (limited to 'lua/lexers/lexer.lua')
-rw-r--r--lua/lexers/lexer.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/lua/lexers/lexer.lua b/lua/lexers/lexer.lua
index d159f70..e7d749f 100644
--- a/lua/lexers/lexer.lua
+++ b/lua/lexers/lexer.lua
@@ -1510,6 +1510,20 @@ function M.embed_lexer(parent, child, start_rule, end_rule)
tokenstyles[token] = style
end
end
+ -- Add child fold symbols.
+ if not parent._foldsymbols then parent._foldsymbols = {} end
+ if child._foldsymbols then
+ for token, symbols in pairs(child._foldsymbols) do
+ if not parent._foldsymbols[token] then parent._foldsymbols[token] = {} end
+ for k, v in pairs(symbols) do
+ if type(k) == 'number' then
+ parent._foldsymbols[token][#parent._foldsymbols[token] + 1] = v
+ elseif not parent._foldsymbols[token][k] then
+ parent._foldsymbols[token][k] = v
+ end
+ end
+ end
+ end
child._lexer = parent -- use parent's tokens if child is embedding itself
parent_lexer = parent -- use parent's tokens if the calling lexer is a proxy
end