aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/gleam.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/gleam.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/gleam.lua')
-rw-r--r--lua/lexers/gleam.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/lua/lexers/gleam.lua b/lua/lexers/gleam.lua
index 6aee725..19eb2d8 100644
--- a/lua/lexers/gleam.lua
+++ b/lua/lexers/gleam.lua
@@ -1,4 +1,4 @@
--- Copyright 2021-2022 Mitchell. See LICENSE.
+-- Copyright 2021-2024 Mitchell. See LICENSE.
-- Gleam LPeg lexer
-- https://gleam.run/
-- Contributed by Tynan Beatty
@@ -88,17 +88,16 @@ local err_tok = token(lexer.ERROR, lexer.any)
lex:add_rule('error', err_tok)
-- Fold points.
-lex:add_fold_point(lexer.COMMENT, lexer.fold_consecutive_lines('//'))
lex:add_fold_point(lexer.OPERATOR, '{', '}')
lex:add_fold_point(lexer.OPERATOR, '[', ']')
lex:add_fold_point(lexer.OPERATOR, '(', ')')
-- Embedded Bit Strings.
-- Mimic lexer.load() by creating a bitstring-specific whitespace style.
-local bitstring = lexer.new(lex._NAME .. '_bitstring')
-local bitstring_ws = token(bitstring._NAME .. '_whitespace', lexer.space^1)
+local bitstring = lexer.new(lex._name .. '_bitstring')
+local bitstring_ws = token(bitstring._name .. '_whitespace', lexer.space^1)
bitstring:add_rule('whitespace', bitstring_ws)
-bitstring:add_style(bitstring._NAME .. '_whitespace', lexer.styles.whitespace)
+bitstring:add_style(bitstring._name .. '_whitespace', lexer.styles.whitespace)
bitstring:add_rule('type', typ_tok)
bitstring:add_rule('module', mod_tok(bitstring_ws))
bitstring:add_rule('keyword', key_tok + token(KEY, word_match{
@@ -116,4 +115,6 @@ bitstring:add_rule('operator', op_tok)
bitstring:add_rule('error', err_tok)
lex:embed(bitstring, token(OP, '<<'), token(OP, '>>'))
+lexer.property['scintillua.comment'] = '//'
+
return lex