vis: implement :set cursorline
[vis.git] / lexers / less.lua
blob2ca3c3870fe1aab436484089f04a0870ed695cb0
1 -- Copyright 2006-2013 Robert Gieseke. See LICENSE.
2 -- Less CSS LPeg lexer.
3 -- http://lesscss.org
5 local l = require('lexer')
6 local token = l.token
7 local S = lpeg.S
9 local M = {_NAME = 'less'}
11 -- Line comments.
12 local line_comment = token(l.COMMENT, '//' * l.nonnewline^0)
14 -- Variables.
15 local variable = token(l.VARIABLE, '@' * (l.alnum + S('_-{}'))^1)
17 local css = l.load('css')
18 local _rules = css._rules
19 table.insert(_rules, #_rules - 1, {'line_comment', line_comment})
20 table.insert(_rules, #_rules - 1, {'variable', variable})
21 M._rules = _rules
23 M._tokenstyles = css._tokenstyles
25 M._foldsymbols = css._foldsymbols
27 return M