1 -- Copyright 2006-2016 Mitchell mitchell.att.foicica.com. See LICENSE.
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'}
11 local html
= l
.load('html')
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)
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