diff options
| author | Matěj Cepl <mcepl@cepl.eu> | 2023-08-11 01:27:32 +0200 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2024-03-27 06:04:21 -0600 |
| commit | 4c4392d29df777ff702dfe99b4f3c23142976e05 (patch) | |
| tree | 5355324abe18952f7d19d6cfc5dbeb5d6cb72b84 /lua/lexers/systemd.lua | |
| parent | 95bf9f59f8a9a37148bdc0787db378d62c7cd032 (diff) | |
| download | vis-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/systemd.lua')
| -rw-r--r-- | lua/lexers/systemd.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/lexers/systemd.lua b/lua/lexers/systemd.lua index 8557a70..00a644d 100644 --- a/lua/lexers/systemd.lua +++ b/lua/lexers/systemd.lua @@ -1,4 +1,4 @@ --- Copyright 2016-2022 Christian Hesse. See LICENSE. +-- Copyright 2016-2024 Christian Hesse. See LICENSE. -- systemd unit file LPeg lexer. local lexer = require('lexer') @@ -122,12 +122,12 @@ lex:add_rule('section', token(lexer.LABEL, '[' * lex:add_rule('comment', token(lexer.COMMENT, lexer.starts_line(lexer.to_eol(S(';#'))))) -- Numbers. -local dec = lexer.digit^1 * ('_' * lexer.digit^1)^0 -local oct_num = '0' * S('01234567_')^1 -local integer = S('+-')^-1 * (lexer.hex_num + oct_num + dec) +local integer = S('+-')^-1 * (lexer.hex_num + lexer.oct_num_('_') + lexer.dec_num_('_')) lex:add_rule('number', token(lexer.NUMBER, lexer.float + integer)) -- Operators. lex:add_rule('operator', token(lexer.OPERATOR, '=')) +lexer.property['scintillua.comment'] = '#' + return lex |
