1 -- Copyright 2006-2013 Robert Gieseke. See LICENSE.
2 -- Sass CSS preprocessor LPeg lexer.
3 -- http://sass-lang.com
5 local l
= require('lexer')
7 local P
, S
= lpeg
.P
, lpeg
.S
9 local M
= {_NAME
= 'sass'}
12 local line_comment
= token(l
.COMMENT
, '//' * l
.nonnewline^
0)
15 local variable
= token(l
.VARIABLE
, '$' * (l
.alnum
+ S('_-'))^
1)
18 local mixin
= token('mixin', P('@') * l
.word
)
20 local css
= l
.load('css')
21 local _rules
= css
._rules
22 table.insert(_rules
, #_rules
- 1, {'mixin', mixin
})
23 table.insert(_rules
, #_rules
- 1, {'line_comment', line_comment
})
24 table.insert(_rules
, #_rules
- 1, {'variable', variable
})
27 M
._tokenstyles
= css
._tokenstyles
28 M
._tokenstyles
['mixin'] = l
.STYLE_FUNCTION
30 M
._foldsymbols
= css
._foldsymbols