diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-12-16 16:24:06 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-12-16 16:24:06 +0100 |
| commit | 2336aeb4c32864f53a4d4e0f72e54a174df47a60 (patch) | |
| tree | e45a039b82b62231a5bde9d58c28cb3df713a77e /src/syntax | |
| parent | 6bbedeaa2c6e0068e2fb6602cbf0002fb6a6ce03 (diff) | |
Tweak parser error messages 🔮
Diffstat (limited to 'src/syntax')
| -rw-r--r-- | src/syntax/token.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/syntax/token.rs b/src/syntax/token.rs index 21a56004..e105ad2f 100644 --- a/src/syntax/token.rs +++ b/src/syntax/token.rs @@ -19,6 +19,8 @@ pub enum Token<'s> { /// /// The comment can contain nested block comments. BlockComment(&'s str), + /// An end of a block comment that was not started. + StarSlash, /// A star: `*`. Star, @@ -83,7 +85,7 @@ pub enum Token<'s> { /// A quoted string: `"..."`. Str(TokenStr<'s>), - /// Things that are not valid in the context they appeared in. + /// Things that are not valid tokens. Invalid(&'s str), } @@ -129,6 +131,7 @@ impl<'s> Token<'s> { Self::LineComment(_) => "line comment", Self::BlockComment(_) => "block comment", + Self::StarSlash => "end of block comment", Self::Star => "star", Self::Underscore => "underscore", @@ -162,7 +165,6 @@ impl<'s> Token<'s> { Self::Hex(_) => "hex value", Self::Str { .. } => "string", - Self::Invalid("*/") => "end of block comment", Self::Invalid(_) => "invalid token", } } |
