Skip to content

Commit 0976042

Browse files
authored
Merge pull request #70 from arezaii/add-attributes-support
add support for lexing attributes. The corresponding changes were added to pygments in PR pygments/pygments#2376
2 parents 4cffb63 + e31d17d commit 0976042

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: sphinxcontrib/chapeldomain/chapel.py

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class ChapelLexer(RegexLexer):
7373
(words(known_types, suffix=r'\b'), Keyword.Type),
7474
(words((*type_modifiers, *other_keywords), suffix=r'\b'), Keyword),
7575

76+
(r'@', Keyword, 'attributename'),
7677
(r'(iter)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
7778
(r'(proc)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
7879
(r'(operator)((?:\s)+)', bygroups(Keyword, Text), 'procname'),
@@ -134,4 +135,7 @@ class ChapelLexer(RegexLexer):
134135
(words(known_types, suffix=r'\b'), Keyword.Type),
135136
(r'[^()]*', Name.Other, '#pop'),
136137
],
138+
'attributename': [
139+
(r'[a-zA-Z_][.\w$]*', Name.Decorator, '#pop'),
140+
],
137141
}

0 commit comments

Comments
 (0)