vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

sass.lua

(549B)


      1 -- Copyright 2006-2025 Robert Gieseke. See LICENSE.
      2 -- Sass CSS preprocessor LPeg lexer.
      3 -- http://sass-lang.com
      4 
      5 local lexer = lexer
      6 local P, S = lpeg.P, lpeg.S
      7 
      8 local lex = lexer.new(..., {inherit = lexer.load('css')})
      9 
     10 -- Line comments.
     11 lex:add_rule('line_comment', lex:tag(lexer.COMMENT, lexer.to_eol('//')))
     12 
     13 -- Variables.
     14 lex:add_rule('variable', lex:tag(lexer.VARIABLE, '$' * (lexer.alnum + S('_-'))^1))
     15 
     16 -- Mixins.
     17 lex:add_rule('mixin', lex:tag(lexer.PREPROCESSOR, '@' * lexer.word))
     18 
     19 lexer.property['scintillua.comment'] = '//'
     20 
     21 return lex