summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorarezaii <Ahmad.rezaii@hpe.com>2023-03-28 17:11:11 -0600
committerGitHub <noreply@github.com>2023-03-29 01:11:11 +0200
commit2a2537d1d26b55a8c558ebda48523951bae2969e (patch)
treeb40dbaa81a084d25bb22331c0453ff3679dd74ef /pygments
parentd2cf5e9e7f3d5ad41427ce51be3f416c7a8aa93f (diff)
downloadpygments-git-2a2537d1d26b55a8c558ebda48523951bae2969e.tar.gz
add support for lexing attributes in Chapel (#2376)
Chapel 1.30 includes support for attributes. The lexer was not able to process them without some adjustments. Co-authored-by: amitkummer <49096391+amitkummer@users.noreply.github.com>
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/chapel.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pygments/lexers/chapel.py b/pygments/lexers/chapel.py
index 908d391e..4beeebb1 100644
--- a/pygments/lexers/chapel.py
+++ b/pygments/lexers/chapel.py
@@ -73,6 +73,7 @@ class ChapelLexer(RegexLexer):
(words(known_types, suffix=r'\b'), Keyword.Type),
(words((*type_modifiers, *other_keywords), suffix=r'\b'), Keyword),
+ (r'@', Keyword, 'attributename'),
(r'(iter)(\s+)', bygroups(Keyword, Whitespace), 'procname'),
(r'(proc)(\s+)', bygroups(Keyword, Whitespace), 'procname'),
(r'(operator)(\s+)', bygroups(Keyword, Whitespace), 'procname'),
@@ -133,4 +134,7 @@ class ChapelLexer(RegexLexer):
(words(known_types, suffix=r'\b'), Keyword.Type),
(r'[^()]*', Name.Other, '#pop'),
],
+ 'attributename': [
+ (r'[a-zA-Z_][.\w$]*', Name.Decorator, '#pop'),
+ ],
}