diff options
Diffstat (limited to 'sqlglotrs/src/tokenizer.rs')
-rw-r--r-- | sqlglotrs/src/tokenizer.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sqlglotrs/src/tokenizer.rs b/sqlglotrs/src/tokenizer.rs index beff96e..8228b5a 100644 --- a/sqlglotrs/src/tokenizer.rs +++ b/sqlglotrs/src/tokenizer.rs @@ -395,6 +395,12 @@ impl<'a> TokenizerState<'a> { .push(self.text()[comment_start_size..].to_string()); } + if comment_start == self.settings.hint_start + && self.tokens.last().is_some() + && self.settings.tokens_preceding_hint.contains(&self.tokens.last().unwrap().token_type) { + self.add(self.token_types.hint, None)?; + } + // Leading comment is attached to the succeeding token, whilst trailing comment to the preceding. // Multiple consecutive comments are preserved by appending them to the current comments list. if Some(comment_start_line) == self.previous_token_line { |