diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-25 20:48:51 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-25 21:14:28 +0100 |
| commit | 3751586e1fbf044fa798737e9c59a0235c5aaee7 (patch) | |
| tree | 417e30516500092e4002d3a6c2dacdd6b3050d90 /lua/lexers/html.lua | |
| parent | b44f174cccd4cd2b1b975f2767335ce636ee273b (diff) | |
| download | vis-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/html.lua')
| -rw-r--r-- | lua/lexers/html.lua | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lua/lexers/html.lua b/lua/lexers/html.lua index 732dfa5..7d29881 100644 --- a/lua/lexers/html.lua +++ b/lua/lexers/html.lua @@ -112,6 +112,13 @@ M._tokenstyles = { doctype = l.STYLE_COMMENT } +M._foldsymbols = { + _patterns = {'</?', '/>', '<!%-%-', '%-%->'}, + element = {['<'] = 1, ['/>'] = -1, ['</'] = -1}, + unknown_element = {['<'] = 1, ['/>'] = -1, ['</'] = -1}, + [l.COMMENT] = {['<!--'] = 1, ['-->'] = -1} +} + -- Tags that start embedded languages. M.embed_start_tag = element * (ws^1 * attribute * ws^0 * equals * ws^0 * string)^0 * @@ -142,6 +149,9 @@ local js_start_rule = #(P('<') * script_element * end))) * M.embed_start_tag -- <script type="text/javascript"> local js_end_rule = #('</' * script_element * ws^0 * '>') * M.embed_end_tag -- </script> +local js_line_comment = '//' * (l.nonnewline_esc - js_end_rule)^0 +local js_block_comment = '/*' * (l.any - '*/' - js_end_rule)^0 * P('*/')^-1 +js._RULES['comment'] = token(l.COMMENT, js_line_comment + js_block_comment) l.embed_lexer(M, js, js_start_rule, js_end_rule) -- Embedded CoffeeScript. @@ -156,11 +166,4 @@ local cs_end_rule = #('</' * script_element * ws^0 * '>') * M.embed_end_tag -- </script> l.embed_lexer(M, cs, cs_start_rule, cs_end_rule) -M._foldsymbols = { - _patterns = {'</?', '/>', '<!%-%-', '%-%->'}, - element = {['<'] = 1, ['/>'] = -1, ['</'] = -1}, - unknown_element = {['<'] = 1, ['/>'] = -1, ['</'] = -1}, - [l.COMMENT] = {['<!--'] = 1, ['-->'] = -1} -} - return M |
