Skip to content

Commit

Permalink
Merge pull request #51 from mystor/truefalse_lit
Browse files Browse the repository at this point in the history
true and false should not be parsed as literals, and should instead be parsed as terms
  • Loading branch information
dtolnay authored Jan 8, 2018
2 parents 3423187 + 7b3bb04 commit 9008f9c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
8 changes: 0 additions & 8 deletions src/stable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,6 @@ named!(literal_nocapture -> (), alt!(
|
int
|
boolean
|
doc_comment
));

Expand Down Expand Up @@ -1142,12 +1140,6 @@ fn digits(mut input: Cursor) -> PResult<()> {
}
}

named!(boolean -> (), alt!(
keyword!("true") => { |_| () }
|
keyword!("false") => { |_| () }
));

fn op(input: Cursor) -> PResult<(char, Spacing)> {
let input = skip_whitespace(input);
match op_char(input) {
Expand Down
19 changes: 0 additions & 19 deletions src/strnom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,25 +374,6 @@ pub fn punct<'a>(input: Cursor<'a>, token: &'static str) -> PResult<'a, &'a str>
}
}

macro_rules! keyword {
($i:expr, $keyword:expr) => {
$crate::strnom::keyword($i, $keyword)
};
}

/// Do not use directly. Use `keyword!`.
pub fn keyword<'a>(input: Cursor<'a>, token: &'static str) -> PResult<'a, &'a str> {
match punct(input, token) {
Ok((rest, _)) => {
match word_break(rest) {
Ok((_, _)) => Ok((rest, token)),
Err(LexError) => Err(LexError),
}
}
Err(LexError) => Err(LexError),
}
}

macro_rules! preceded {
($i:expr, $submac:ident!( $($args:tt)* ), $submac2:ident!( $($args2:tt)* )) => {
match tuple!($i, $submac!($($args)*), $submac2!($($args2)*)) {
Expand Down

0 comments on commit 9008f9c

Please sign in to comment.