vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
less.lua
(480B)
1 -- Copyright 2006-2025 Robert Gieseke. See LICENSE.
2 -- Less CSS LPeg lexer.
3 -- http://lesscss.org
4
5 local lexer = require('lexer')
6 local token = lexer.token
7 local S = lpeg.S
8
9 local lex = lexer.new('less', {inherit = lexer.load('css')})
10
11 -- Line comments.
12 lex:add_rule('line_comment', token(lexer.COMMENT, lexer.to_eol('//')))
13
14 -- Variables.
15 lex:add_rule('variable', token(lexer.VARIABLE, '@' * (lexer.alnum + S('_-{}'))^1))
16
17 lexer.property['scintillua.comment'] = '//'
18
19 return lex