Skip to content

Commit

Permalink
Add @ prefix on else back in
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Feb 7, 2016
1 parent 3938739 commit 1b30744
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions maud_macros/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ impl<'cx, 'i> Parser<'cx, 'i> {
},
[] => parse_error!(self, sp, "expected body for this @if"),
}}
// Parse the (optional) else
// Parse the (optional) @else
let else_body = match self.input {
[keyword!(_, k), ..] if k.is_keyword(Keyword::Else) => {
self.shift(1);
[at!(), keyword!(_, k), ..] if k.is_keyword(Keyword::Else) => {
self.shift(2);
match self.input {
[keyword!(sp, k), ..] if k.is_keyword(Keyword::If) => {
self.shift(1);
Expand Down
8 changes: 4 additions & 4 deletions maud_macros/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ mod control {
html!(s, {
@if number == 1 {
"one"
} else if number == 2 {
} @else if number == 2 {
"two"
} else if number == 3 {
} @else if number == 3 {
"three"
} else {
} @else {
"oh noes"
}
}).unwrap();
Expand All @@ -226,7 +226,7 @@ mod control {
html!(s, {
@if let Some(value) = input {
^value
} else {
} @else {
"oh noes"
}
}).unwrap();
Expand Down

0 comments on commit 1b30744

Please sign in to comment.