summaryrefslogtreecommitdiff
path: root/pygments/lexers/rust.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-03-05 10:05:13 +0100
committerGeorg Brandl <georg@python.org>2021-03-05 10:06:49 +0100
commitcbce3c598d8699cc6bd727ccaac17c218ac5c93f (patch)
tree40a85bba338d088af11646174e1f81b01edb552b /pygments/lexers/rust.py
parent6ead43dad09567bed525a7127cf6f7f6f768a807 (diff)
downloadpygments-git-cbce3c598d8699cc6bd727ccaac17c218ac5c93f.tar.gz
Rust: accept lone hashes as they can appear in macro arguments
fixes #1061
Diffstat (limited to 'pygments/lexers/rust.py')
-rw-r--r--pygments/lexers/rust.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pygments/lexers/rust.py b/pygments/lexers/rust.py
index 3a162b00..172855e0 100644
--- a/pygments/lexers/rust.py
+++ b/pygments/lexers/rust.py
@@ -152,6 +152,11 @@ class RustLexer(RegexLexer):
# Attributes
(r'#!?\[', Comment.Preproc, 'attribute['),
+
+ # Misc
+ # Lone hashes: not used in Rust syntax, but allowed in macro
+ # arguments, most famously for quote::quote!()
+ (r'#', Text),
],
'comment': [
(r'[^*/]+', Comment.Multiline),