Skip to content

Commit 48c64db

Browse files
committed
Merge pull request zargony#59 from flying-sheep/macro-arrow
made all rust operators tokenize as unit
2 parents 0b92d92 + d95861f commit 48c64db

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

grammars/rust.cson

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,29 @@
249249
{ 'include': '#pub' }
250250
# Operators
251251
{
252-
'comment': 'Operator'
253-
'name': 'keyword.operator.rust'
254-
'match': '(\\+|-|/|\\*|=|<=|>=|\\^|&|\\||!|%|::|\\bas\\b|<<|>>|>|<)'
252+
'comment': 'Miscellaneous operator'
253+
'name': 'keyword.operator.misc.rust'
254+
'match': '(=>|::|\\bas\\b)'
255+
}
256+
{
257+
'comment': 'Comparison operator'
258+
'name': 'keyword.operator.comparison.rust'
259+
'match': '(&&|\\|\\||==|!=)'
260+
}
261+
{
262+
'comment': 'Assignment operator'
263+
'name': 'keyword.operator.assignment.rust'
264+
'match': '(\\+=|-=|/=|\\*=|%=|\\^=|&=|\\|=|<<=|>>=|=)'
265+
}
266+
{
267+
'comment': 'Arithmetic operator'
268+
'name': 'keyword.operator.arithmetic.rust'
269+
'match': '(!|\\+|-|/|\\*|%|\\^|&|\\||<<|>>)'
270+
}
271+
{
272+
'comment': 'Comparison operator (second group because of regex precedence)'
273+
'name': 'keyword.operator.comparison.rust'
274+
'match': '(<=|>=|<|>)'
255275
}
256276
# Standard types and traits
257277
{ 'include': '#core_types' }

0 commit comments

Comments
 (0)