From a4a5a6907acf6361618a8aa723a4bacc489f270a Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 14 Jul 2020 10:09:33 -0400 Subject: lexlua: Minor pattern refactoring. --- lexlua/python.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lexlua/python.lua') diff --git a/lexlua/python.lua b/lexlua/python.lua index 4786e7a44..629f61f7a 100644 --- a/lexlua/python.lua +++ b/lexlua/python.lua @@ -3,7 +3,7 @@ local lexer = require('lexer') local token, word_match = lexer.token, lexer.word_match -local P, R, S = lpeg.P, lpeg.R, lpeg.S +local P, S = lpeg.P, lpeg.S local lex = lexer.new('python', {fold_by_indentation = true}) @@ -86,9 +86,9 @@ lex:add_rule('string', token(lexer.STRING, tq_str + sq_str + dq_str + raw_sq_str + raw_dq_str)) -- Numbers. -local dec = lexer.digit^1 * S('Ll')^-1 +local dec = lexer.dec_num * S('Ll')^-1 local bin = '0b' * S('01')^1 * ('_' * S('01')^1)^0 -local oct = '0' * R('07')^1 * S('Ll')^-1 +local oct = lexer.oct_num * S('Ll')^-1 local integer = S('+-')^-1 * (bin + lexer.hex_num + oct + dec) lex:add_rule('number', token(lexer.NUMBER, lexer.float + integer)) -- cgit v1.2.3