aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/sass.lua
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-08-11 01:27:32 +0200
committerRandy Palamar <randy@rnpnr.xyz>2024-03-27 06:04:21 -0600
commit4c4392d29df777ff702dfe99b4f3c23142976e05 (patch)
tree5355324abe18952f7d19d6cfc5dbeb5d6cb72b84 /lua/lexers/sass.lua
parent95bf9f59f8a9a37148bdc0787db378d62c7cd032 (diff)
downloadvis-4c4392d29df777ff702dfe99b4f3c23142976e05.tar.gz
vis-4c4392d29df777ff702dfe99b4f3c23142976e05.tar.xz
update lexers to orbitalquark/scintillua@b789dde
Rather than cherry pick patches from after 6.2 we will just grab everything as is.
Diffstat (limited to 'lua/lexers/sass.lua')
-rw-r--r--lua/lexers/sass.lua17
1 files changed, 7 insertions, 10 deletions
diff --git a/lua/lexers/sass.lua b/lua/lexers/sass.lua
index bb14e1d..c281227 100644
--- a/lua/lexers/sass.lua
+++ b/lua/lexers/sass.lua
@@ -1,24 +1,21 @@
--- Copyright 2006-2022 Robert Gieseke. See LICENSE.
+-- Copyright 2006-2024 Robert Gieseke. See LICENSE.
-- Sass CSS preprocessor LPeg lexer.
-- http://sass-lang.com
-local lexer = require('lexer')
-local token = lexer.token
+local lexer = lexer
local P, S = lpeg.P, lpeg.S
-local lex = lexer.new('sass', {inherit = lexer.load('css')})
+local lex = lexer.new(..., {inherit = lexer.load('css')})
-- Line comments.
-lex:add_rule('line_comment', token(lexer.COMMENT, lexer.to_eol('//')))
+lex:add_rule('line_comment', lex:tag(lexer.COMMENT, lexer.to_eol('//')))
-- Variables.
-lex:add_rule('variable', token(lexer.VARIABLE, '$' * (lexer.alnum + S('_-'))^1))
+lex:add_rule('variable', lex:tag(lexer.VARIABLE, '$' * (lexer.alnum + S('_-'))^1))
-- Mixins.
-lex:add_rule('mixin', token('mixin', '@' * lexer.word))
-lex:add_style('mixin', lexer.styles['function'])
+lex:add_rule('mixin', lex:tag(lexer.PREPROCESSOR, '@' * lexer.word))
--- Fold points.
-lex:add_fold_point(lexer.COMMENT, lexer.fold_consecutive_lines('//'))
+lexer.property['scintillua.comment'] = '//'
return lex