aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlua/rust.lua
diff options
context:
space:
mode:
authormitchell <unknown>2020-01-07 18:52:03 -0500
committermitchell <unknown>2020-01-07 18:52:03 -0500
commiteda830b848defa3f650a3fe748351479f4bfba46 (patch)
treebc6a6f06e6310989ac2d7f11a4bf1f1b558e3cf7 /lexlua/rust.lua
parent3000cb8290100ca6196403a862d918c00fab729e (diff)
downloadscintilla-mirror-eda830b848defa3f650a3fe748351479f4bfba46.tar.gz
lexlua: Removed unnecessary `lpeg.B()` in Rust lexer.
Rule order makes it such that the 'r#' prefix will never happen prior to a keyword.
Diffstat (limited to 'lexlua/rust.lua')
-rw-r--r--lexlua/rust.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lexlua/rust.lua b/lexlua/rust.lua
index 543bd066d..7546e8c6d 100644
--- a/lexlua/rust.lua
+++ b/lexlua/rust.lua
@@ -3,7 +3,7 @@
local lexer = require("lexer")
local token, word_match = lexer.token, lexer.word_match
-local B, P, R, S, V = lpeg.B, lpeg.P, lpeg.R, lpeg.S, lpeg.V
+local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V
local C, Cmt = lpeg.C, lpeg.Cmt
local lex = lexer.new('rust')
@@ -13,7 +13,7 @@ lex:add_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1))
-- Keywords.
-- https://github.com/rust-lang/rust/blob/stable/src/libsyntax_pos/symbol.rs
-lex:add_rule('keyword', token(lexer.KEYWORD, B(-P('r#')) * word_match[[
+lex:add_rule('keyword', token(lexer.KEYWORD, word_match[[
Self abstract as async auto await become box break catch const continue crate
default do dyn else enum extern false final fn for if impl in let loop macro
match mod move mut override priv pub ref return self static struct super