Skip to content

Commit e1ada9b

Browse files
committedJan 2, 2022
Remove trailing semicolons from macro bodies
This removes warnings about "trailing semicolon in macro used in expression position".
1 parent 0e03e1c commit e1ada9b

File tree

2 files changed

+53
-53
lines changed

2 files changed

+53
-53
lines changed
 

‎html5ever/src/tokenizer/mod.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -575,30 +575,30 @@ impl<Sink: TokenSink> Tokenizer<Sink> {
575575

576576
// Shorthand for common state machine behaviors.
577577
macro_rules! shorthand (
578-
( $me:ident : emit $c:expr ) => ( $me.emit_char($c); );
579-
( $me:ident : create_tag $kind:ident $c:expr ) => ( $me.create_tag($kind, $c); );
580-
( $me:ident : push_tag $c:expr ) => ( $me.current_tag_name.push_char($c); );
581-
( $me:ident : discard_tag ) => ( $me.discard_tag(); );
582-
( $me:ident : discard_char $input:expr ) => ( $me.discard_char($input); );
583-
( $me:ident : push_temp $c:expr ) => ( $me.temp_buf.push_char($c); );
584-
( $me:ident : emit_temp ) => ( $me.emit_temp_buf(); );
585-
( $me:ident : clear_temp ) => ( $me.clear_temp_buf(); );
586-
( $me:ident : create_attr $c:expr ) => ( $me.create_attribute($c); );
587-
( $me:ident : push_name $c:expr ) => ( $me.current_attr_name.push_char($c); );
588-
( $me:ident : push_value $c:expr ) => ( $me.current_attr_value.push_char($c); );
589-
( $me:ident : append_value $c:expr ) => ( $me.current_attr_value.push_tendril($c); );
590-
( $me:ident : push_comment $c:expr ) => ( $me.current_comment.push_char($c); );
591-
( $me:ident : append_comment $c:expr ) => ( $me.current_comment.push_slice($c); );
592-
( $me:ident : emit_comment ) => ( $me.emit_current_comment(); );
593-
( $me:ident : clear_comment ) => ( $me.current_comment.clear(); );
594-
( $me:ident : create_doctype ) => ( $me.current_doctype = Doctype::new(); );
595-
( $me:ident : push_doctype_name $c:expr ) => ( option_push(&mut $me.current_doctype.name, $c); );
596-
( $me:ident : push_doctype_id $k:ident $c:expr ) => ( option_push($me.doctype_id($k), $c); );
597-
( $me:ident : clear_doctype_id $k:ident ) => ( $me.clear_doctype_id($k); );
598-
( $me:ident : force_quirks ) => ( $me.current_doctype.force_quirks = true; );
599-
( $me:ident : emit_doctype ) => ( $me.emit_current_doctype(); );
600-
( $me:ident : error ) => ( $me.bad_char_error(); );
601-
( $me:ident : error_eof ) => ( $me.bad_eof_error(); );
578+
( $me:ident : emit $c:expr ) => ( $me.emit_char($c) );
579+
( $me:ident : create_tag $kind:ident $c:expr ) => ( $me.create_tag($kind, $c) );
580+
( $me:ident : push_tag $c:expr ) => ( $me.current_tag_name.push_char($c) );
581+
( $me:ident : discard_tag ) => ( $me.discard_tag() );
582+
( $me:ident : discard_char $input:expr ) => ( $me.discard_char($input) );
583+
( $me:ident : push_temp $c:expr ) => ( $me.temp_buf.push_char($c) );
584+
( $me:ident : emit_temp ) => ( $me.emit_temp_buf() );
585+
( $me:ident : clear_temp ) => ( $me.clear_temp_buf() );
586+
( $me:ident : create_attr $c:expr ) => ( $me.create_attribute($c) );
587+
( $me:ident : push_name $c:expr ) => ( $me.current_attr_name.push_char($c) );
588+
( $me:ident : push_value $c:expr ) => ( $me.current_attr_value.push_char($c) );
589+
( $me:ident : append_value $c:expr ) => ( $me.current_attr_value.push_tendril($c) );
590+
( $me:ident : push_comment $c:expr ) => ( $me.current_comment.push_char($c) );
591+
( $me:ident : append_comment $c:expr ) => ( $me.current_comment.push_slice($c) );
592+
( $me:ident : emit_comment ) => ( $me.emit_current_comment() );
593+
( $me:ident : clear_comment ) => ( $me.current_comment.clear() );
594+
( $me:ident : create_doctype ) => ( $me.current_doctype = Doctype::new() );
595+
( $me:ident : push_doctype_name $c:expr ) => ( option_push(&mut $me.current_doctype.name, $c) );
596+
( $me:ident : push_doctype_id $k:ident $c:expr ) => ( option_push($me.doctype_id($k), $c) );
597+
( $me:ident : clear_doctype_id $k:ident ) => ( $me.clear_doctype_id($k) );
598+
( $me:ident : force_quirks ) => ( $me.current_doctype.force_quirks = true );
599+
( $me:ident : emit_doctype ) => ( $me.emit_current_doctype() );
600+
( $me:ident : error ) => ( $me.bad_char_error() );
601+
( $me:ident : error_eof ) => ( $me.bad_eof_error() );
602602
);
603603

604604
// Tracing of tokenizer actions. This adds significant bloat and compile time,
@@ -644,7 +644,7 @@ macro_rules! go (
644644
( $me:ident : eof ) => ({ $me.emit_eof(); return ProcessResult::Suspend; });
645645

646646
// If nothing else matched, it's a single command
647-
( $me:ident : $($cmd:tt)+ ) => ( sh_trace!($me: $($cmd)+); );
647+
( $me:ident : $($cmd:tt)+ ) => ( sh_trace!($me: $($cmd)+) );
648648

649649
// or nothing.
650650
( $me:ident : ) => (());

‎xml5ever/src/tokenizer/mod.rs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -517,33 +517,33 @@ impl<Sink: TokenSink> XmlTokenizer<Sink> {
517517

518518
// Shorthand for common state machine behaviors.
519519
macro_rules! shorthand (
520-
( $me:ident : emit $c:expr ) => ( $me.emit_char($c); );
521-
( $me:ident : create_tag $kind:ident $c:expr ) => ( $me.create_tag($kind, $c); );
522-
( $me:ident : push_tag $c:expr ) => ( $me.current_tag_name.push_char($c); );
523-
( $me:ident : discard_tag $input:expr ) => ( $me.discard_tag($input); );
524-
( $me:ident : discard_char ) => ( $me.discard_char(); );
525-
( $me:ident : push_temp $c:expr ) => ( $me.temp_buf.push_char($c); );
526-
( $me:ident : emit_temp ) => ( $me.emit_temp_buf(); );
527-
( $me:ident : clear_temp ) => ( $me.clear_temp_buf(); );
528-
( $me:ident : create_attr $c:expr ) => ( $me.create_attribute($c); );
529-
( $me:ident : push_name $c:expr ) => ( $me.current_attr_name.push_char($c); );
530-
( $me:ident : push_value $c:expr ) => ( $me.current_attr_value.push_char($c); );
531-
( $me:ident : append_value $c:expr ) => ( $me.current_attr_value.push_tendril($c); );
532-
( $me:ident : push_comment $c:expr ) => ( $me.current_comment.push_char($c); );
533-
( $me:ident : append_comment $c:expr ) => ( $me.current_comment.push_slice($c); );
534-
( $me:ident : emit_comment ) => ( $me.emit_current_comment(); );
535-
( $me:ident : clear_comment ) => ( $me.current_comment.clear(); );
536-
( $me:ident : create_doctype ) => ( $me.current_doctype = Doctype::new(); );
537-
( $me:ident : push_doctype_name $c:expr ) => ( option_push(&mut $me.current_doctype.name, $c); );
538-
( $me:ident : push_doctype_id $k:ident $c:expr ) => ( option_push($me.doctype_id($k), $c); );
539-
( $me:ident : clear_doctype_id $k:ident ) => ( $me.clear_doctype_id($k); );
540-
( $me:ident : emit_doctype ) => ( $me.emit_current_doctype(); );
541-
( $me:ident : error ) => ( $me.bad_char_error(); );
542-
( $me:ident : error_eof ) => ( $me.bad_eof_error(); );
543-
( $me:ident : create_pi $c:expr ) => ( $me.create_pi($c); );
544-
( $me:ident : push_pi_target $c:expr ) => ( $me.current_pi_target.push_char($c); );
545-
( $me:ident : push_pi_data $c:expr ) => ( $me.current_pi_data.push_char($c); );
546-
( $me:ident : set_empty_tag ) => ( $me.set_empty_tag(); );
520+
( $me:ident : emit $c:expr ) => ( $me.emit_char($c) );
521+
( $me:ident : create_tag $kind:ident $c:expr ) => ( $me.create_tag($kind, $c) );
522+
( $me:ident : push_tag $c:expr ) => ( $me.current_tag_name.push_char($c) );
523+
( $me:ident : discard_tag $input:expr ) => ( $me.discard_tag($input) );
524+
( $me:ident : discard_char ) => ( $me.discard_char() );
525+
( $me:ident : push_temp $c:expr ) => ( $me.temp_buf.push_char($c) );
526+
( $me:ident : emit_temp ) => ( $me.emit_temp_buf() );
527+
( $me:ident : clear_temp ) => ( $me.clear_temp_buf() );
528+
( $me:ident : create_attr $c:expr ) => ( $me.create_attribute($c) );
529+
( $me:ident : push_name $c:expr ) => ( $me.current_attr_name.push_char($c) );
530+
( $me:ident : push_value $c:expr ) => ( $me.current_attr_value.push_char($c) );
531+
( $me:ident : append_value $c:expr ) => ( $me.current_attr_value.push_tendril($c) );
532+
( $me:ident : push_comment $c:expr ) => ( $me.current_comment.push_char($c) );
533+
( $me:ident : append_comment $c:expr ) => ( $me.current_comment.push_slice($c) );
534+
( $me:ident : emit_comment ) => ( $me.emit_current_comment() );
535+
( $me:ident : clear_comment ) => ( $me.current_comment.clear() );
536+
( $me:ident : create_doctype ) => ( $me.current_doctype = Doctype::new() );
537+
( $me:ident : push_doctype_name $c:expr ) => ( option_push(&mut $me.current_doctype.name, $c) );
538+
( $me:ident : push_doctype_id $k:ident $c:expr ) => ( option_push($me.doctype_id($k), $c) );
539+
( $me:ident : clear_doctype_id $k:ident ) => ( $me.clear_doctype_id($k) );
540+
( $me:ident : emit_doctype ) => ( $me.emit_current_doctype() );
541+
( $me:ident : error ) => ( $me.bad_char_error() );
542+
( $me:ident : error_eof ) => ( $me.bad_eof_error() );
543+
( $me:ident : create_pi $c:expr ) => ( $me.create_pi($c) );
544+
( $me:ident : push_pi_target $c:expr ) => ( $me.current_pi_target.push_char($c) );
545+
( $me:ident : push_pi_data $c:expr ) => ( $me.current_pi_data.push_char($c) );
546+
( $me:ident : set_empty_tag ) => ( $me.set_empty_tag() );
547547
);
548548

549549
// Tracing of tokenizer actions. This adds significant bloat and compile time,
@@ -615,7 +615,7 @@ macro_rules! go (
615615
( $me:ident : eof ) => ({ $me.emit_eof(); return false; });
616616

617617
// If nothing else matched, it's a single command
618-
( $me:ident : $($cmd:tt)+ ) => ( sh_trace!($me: $($cmd)+); );
618+
( $me:ident : $($cmd:tt)+ ) => ( sh_trace!($me: $($cmd)+) );
619619

620620
// or nothing.
621621
( $me:ident : ) => (());

0 commit comments

Comments
 (0)
Please sign in to comment.