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/php.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lexlua/php.lua') diff --git a/lexlua/php.lua b/lexlua/php.lua index 05589d649..07886f950 100644 --- a/lexlua/php.lua +++ b/lexlua/php.lua @@ -3,7 +3,7 @@ local lexer = require('lexer') local token, word_match = lexer.token, lexer.word_match -local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V +local P, S, V = lpeg.P, lpeg.S, lpeg.V local lex = lexer.new('php') @@ -21,8 +21,8 @@ lex:add_rule('keyword', token(lexer.KEYWORD, word_match[[ __class__ __file__ __function__ __line__ __sleep __wakeup ]])) -local word = (lexer.alpha + '_' + R('\127\255')) * - (lexer.alnum + '_' + R('\127\255'))^0 +local word = (lexer.alpha + '_' + lpeg.R('\127\255')) * + (lexer.alnum + '_' + lpeg.R('\127\255'))^0 -- Identifiers. lex:add_rule('identifier', token(lexer.IDENTIFIER, word)) -- cgit v1.2.3