Skip to content

Commit 9008f9c

Browse files
authored
Merge pull request #51 from mystor/truefalse_lit
true and false should not be parsed as literals, and should instead be parsed as terms
2 parents 3423187 + 7b3bb04 commit 9008f9c

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/stable.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,6 @@ named!(literal_nocapture -> (), alt!(
718718
|
719719
int
720720
|
721-
boolean
722-
|
723721
doc_comment
724722
));
725723

@@ -1142,12 +1140,6 @@ fn digits(mut input: Cursor) -> PResult<()> {
11421140
}
11431141
}
11441142

1145-
named!(boolean -> (), alt!(
1146-
keyword!("true") => { |_| () }
1147-
|
1148-
keyword!("false") => { |_| () }
1149-
));
1150-
11511143
fn op(input: Cursor) -> PResult<(char, Spacing)> {
11521144
let input = skip_whitespace(input);
11531145
match op_char(input) {

src/strnom.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -374,25 +374,6 @@ pub fn punct<'a>(input: Cursor<'a>, token: &'static str) -> PResult<'a, &'a str>
374374
}
375375
}
376376

377-
macro_rules! keyword {
378-
($i:expr, $keyword:expr) => {
379-
$crate::strnom::keyword($i, $keyword)
380-
};
381-
}
382-
383-
/// Do not use directly. Use `keyword!`.
384-
pub fn keyword<'a>(input: Cursor<'a>, token: &'static str) -> PResult<'a, &'a str> {
385-
match punct(input, token) {
386-
Ok((rest, _)) => {
387-
match word_break(rest) {
388-
Ok((_, _)) => Ok((rest, token)),
389-
Err(LexError) => Err(LexError),
390-
}
391-
}
392-
Err(LexError) => Err(LexError),
393-
}
394-
}
395-
396377
macro_rules! preceded {
397378
($i:expr, $submac:ident!( $($args:tt)* ), $submac2:ident!( $($args2:tt)* )) => {
398379
match tuple!($i, $submac!($($args)*), $submac2!($($args2)*)) {

0 commit comments

Comments
 (0)