summaryrefslogtreecommitdiffstats
path: root/sqlglotrs/src/tokenizer.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-03 14:11:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-03 14:11:03 +0000
commit5d0ea770947ae1da51537ff75b14b48218d729aa (patch)
tree86e66fc69feeae4c4b23749e7779f6731791edcc /sqlglotrs/src/tokenizer.rs
parentAdding upstream version 21.1.2. (diff)
downloadsqlglot-5d0ea770947ae1da51537ff75b14b48218d729aa.tar.xz
sqlglot-5d0ea770947ae1da51537ff75b14b48218d729aa.zip
Adding upstream version 22.2.0.upstream/22.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglotrs/src/tokenizer.rs')
-rw-r--r--sqlglotrs/src/tokenizer.rs18
1 files changed, 2 insertions, 16 deletions
diff --git a/sqlglotrs/src/tokenizer.rs b/sqlglotrs/src/tokenizer.rs
index 94a8b08..2c90a65 100644
--- a/sqlglotrs/src/tokenizer.rs
+++ b/sqlglotrs/src/tokenizer.rs
@@ -178,15 +178,6 @@ impl<'a> TokenizerState<'a> {
Ok(())
}
- fn peek(&self, i: usize) -> Result<char, TokenizerError> {
- let index = self.current + i;
- if index < self.size {
- self.char_at(index)
- } else {
- Ok('\0')
- }
- }
-
fn chars(&self, size: usize) -> String {
let start = self.current - 1;
let end = start + size;
@@ -469,13 +460,8 @@ impl<'a> TokenizerState<'a> {
if self.peek_char.is_digit(10) {
self.advance(1)?;
} else if self.peek_char == '.' && !decimal {
- let after = self.peek(1)?;
- if after.is_digit(10) || !after.is_alphabetic() {
- decimal = true;
- self.advance(1)?;
- } else {
- return self.add(self.token_types.var, None);
- }
+ decimal = true;
+ self.advance(1)?;
} else if (self.peek_char == '-' || self.peek_char == '+') && scientific == 1 {
scientific += 1;
self.advance(1)?;