aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lexers/ini.lua')
-rw-r--r--lua/lexers/ini.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/lexers/ini.lua b/lua/lexers/ini.lua
index a2b107e..15ebd06 100644
--- a/lua/lexers/ini.lua
+++ b/lua/lexers/ini.lua
@@ -1,4 +1,4 @@
--- Copyright 2006-2022 Mitchell. See LICENSE.
+-- Copyright 2006-2024 Mitchell. See LICENSE.
-- Ini LPeg lexer.
local lexer = require('lexer')
@@ -28,12 +28,12 @@ lex:add_rule('label', token(lexer.LABEL, lexer.range('[', ']', true)))
lex:add_rule('comment', token(lexer.COMMENT, lexer.to_eol(lexer.starts_line(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