Skip to content

Commit f653ba3

Browse files
TheIronBornjasonwilliams
authored andcommitted
Syntax: Allow comments in macro definitions (#305)
* Allow comments in macro definitions * macro comment test
1 parent 0c2b800 commit f653ba3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

RustEnhanced.sublime-syntax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ contexts:
646646
pop: true
647647

648648
macro-matcher:
649+
- include: comments
649650
- meta_include_prototype: false
650651
- meta_scope: meta.group.rust
651652
- match: '\)'

syntax_test_rust.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -867,9 +867,10 @@ pub fn from_buf_reader<T>(s: io::BufReader<T>) -> Result<isize, &'static str>
867867
// ^ keyword.other
868868
{
869869
macro_rules! eat_numbers {
870-
($count:expr, $msg:expr) => {{
871-
// ^ meta.function meta.block meta.macro meta.block meta.block punctuation.definition.block.begin
872-
// ^ meta.function meta.block meta.macro meta.block meta.block meta.block punctuation.definition.block.begin
870+
($count:expr, /*$comment:ident,*/ $msg:expr) => {{
871+
// ^^^^^^^^^^^^^^^^^^^ meta.function.rust meta.block.rust meta.macro.rust meta.block.rust meta.group.rust comment.block.rust
872+
// ^ meta.function meta.block meta.macro meta.block meta.block punctuation.definition.block.begin
873+
// ^ meta.function meta.block meta.macro meta.block meta.block meta.block punctuation.definition.block.begin
873874
let parse_err = concat!("Err parsing value in ", $msg);
874875
try!{ eat_numbers(&mut lines, $count, parse_err, missing_err, too_many) }
875876
// ^^^^ support.macro

0 commit comments

Comments
 (0)