diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-02-03 12:22:02 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-02-03 12:22:02 +0100 |
| commit | 3150fd56437ecf8b2a5902c18e3f9ace800b768c (patch) | |
| tree | db8a7e9fc868145804db97da81bd0669aaf55454 /src/syntax/parsing.rs | |
| parent | 40ea35cbe7482ce04096c4d63a848c8601cc1848 (diff) | |
Better Debug/Display and Derives 🧽
Diffstat (limited to 'src/syntax/parsing.rs')
| -rw-r--r-- | src/syntax/parsing.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/syntax/parsing.rs b/src/syntax/parsing.rs index 1e8cc74f..a7f39640 100644 --- a/src/syntax/parsing.rs +++ b/src/syntax/parsing.rs @@ -18,6 +18,7 @@ pub struct ParseContext<'a> { /// The result of parsing: Some parsed thing, errors and decorations for syntax /// highlighting. +#[derive(Debug, Clone, Eq, PartialEq)] pub struct Parsed<T> { /// The result of the parsing process. pub output: T, @@ -321,9 +322,11 @@ impl<'s> FuncParser<'s> { /// Skip all whitespace/comment tokens. fn skip_whitespace(&mut self) { - self.eat_until(|t| !matches!(t, + self.eat_until(|t| match t { Token::Space(_) | Token::LineComment(_) | - Token::BlockComment(_)), false) + Token::BlockComment(_) => false, + _ => true, + }, false) } /// Add an error about an expected `thing` which was not found, showing |
