Skip to content

Commit

Permalink
Allow @ws as an alias for @whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaj committed Jan 25, 2019
1 parent 2c32efb commit 16ea2dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/templateexpression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ named!(
alt!(tag!("*") | tag!(":") | tag!("@") |
tag!("{") | tag!("}") |
terminated!(
alt!(tag!("if") | tag!("for") | tag!("whitespace")),
alt!(tag!("if") | tag!("for") |
tag!("whitespace") | tag!("ws")),
tag!(" ")) |
value!(Input(&b""[..]))))),
Some(Input(b":")) => map!(
Expand Down Expand Up @@ -287,15 +288,16 @@ named!(
expr: expr.to_string(),
body,
}) |
Some(Input(b"whitespace")) => map!(
Some(Input(b"whitespace"))
| Some(Input(b"ws")) => map!(
tuple!(
delimited!(tag!("("),
delimited!(delimited!(spacelike, tag!("("), spacelike),
alt!(
value!(SpaceMode::AsIs, tag!("as-is")) |
value!(SpaceMode::Compact, tag!("compact")) |
value!(SpaceMode::Removed, tag!("removed"))
),
terminated!(tag!(")"), spacelike)),
delimited!(spacelike, tag!(")"), spacelike)),
template_block
),
|(mode, body)| {
Expand Down

0 comments on commit 16ea2dd

Please sign in to comment.