Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/event.rs')
| -rw-r--r-- | crates/parser/src/event.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/parser/src/event.rs b/crates/parser/src/event.rs index b0e70e7943..fb2616cf01 100644 --- a/crates/parser/src/event.rs +++ b/crates/parser/src/event.rs @@ -72,9 +72,12 @@ pub(crate) enum Event { /// `n_raw_tokens = 2` is used to produced a single `>>`. Token { kind: SyntaxKind, + // Consider custom enum here? n_raw_tokens: u8, }, - + FloatSplitHack { + has_pseudo_dot: bool, + }, Error { msg: String, }, @@ -125,6 +128,11 @@ pub(super) fn process(mut events: Vec<Event>) -> Output { Event::Token { kind, n_raw_tokens } => { res.token(kind, n_raw_tokens); } + Event::FloatSplitHack { has_pseudo_dot } => { + res.float_split_hack(has_pseudo_dot); + let ev = mem::replace(&mut events[i + 1], Event::tombstone()); + assert!(matches!(ev, Event::Finish), "{ev:?}"); + } Event::Error { msg } => res.error(msg), } } |