Skip to content

Commit

Permalink
Syntax: Add literal fragment macro matcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jan 27, 2019
1 parent 1fb301b commit aac62d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion RustEnhanced.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ contexts:
pop: true
- include: macro-matchers

- match: '(\$\s*{{identifier}})\s*(:)\s*(ident|path|expr|ty|pat|stmt|block|item|meta|tt|lifetime|vis)'
- match: '(\$\s*{{identifier}})\s*(:)\s*(ident|path|expr|ty|pat|stmt|block|item|meta|tt|lifetime|vis|literal)'
captures:
1: variable.parameter.rust
2: punctuation.separator.rust
Expand Down
3 changes: 3 additions & 0 deletions tests/syntax-rust/syntax_test_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ macro_rules! designators {
$v:vis,
// ^^ variable.parameter
// ^^^ storage.type
$l:literal,
// ^^ variable.parameter
// ^^^^^^^ storage.type
) => ();
// And various tokens
("Any token" /*comment*/ true => 3.14 'life 'c' @ struct self) => ();
Expand Down

0 comments on commit aac62d9

Please sign in to comment.