ui: add support for blink style attribute
[vis.git] / lexers / jsp.lua
blob44f53d26e6ede07f4c6fde12b6ede11b7d4627a8
1 -- Copyright 2006-2016 Mitchell mitchell.att.foicica.com. See LICENSE.
2 -- JSP LPeg lexer.
4 local l = require('lexer')
5 local token, word_match = l.token, l.word_match
6 local P, R, S = lpeg.P, lpeg.R, lpeg.S
8 local M = {_NAME = 'jsp'}
10 -- Embedded in HTML.
11 local html = l.load('html')
13 -- Embedded Java.
14 local java = l.load('java')
15 local java_start_rule = token('jsp_tag', '<%' * P('=')^-1)
16 local java_end_rule = token('jsp_tag', '%>')
17 l.embed_lexer(html, java, java_start_rule, java_end_rule, true)
19 M._tokenstyles = {
20 jsp_tag = l.STYLE_EMBEDDED
23 local _foldsymbols = html._foldsymbols
24 _foldsymbols._patterns[#_foldsymbols._patterns + 1] = '<%%'
25 _foldsymbols._patterns[#_foldsymbols._patterns + 1] = '%%>'
26 _foldsymbols.jsp_tag = {['<%'] = 1, ['%>'] = -1}
27 M._foldsymbols = _foldsymbols
29 return M