Skip to content

Commit

Permalink
Chore: cleanup identifer
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed Jun 6, 2023
1 parent def5a03 commit a30a828
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions sqlglot/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4038,22 +4038,15 @@ def _parse_id_var(
self,
any_token: bool = True,
tokens: t.Optional[t.Collection[TokenType]] = None,
prefix_tokens: t.Optional[t.Collection[TokenType]] = None,
) -> t.Optional[exp.Expression]:
identifier = self._parse_identifier()

if identifier:
return identifier

prefix = ""

if prefix_tokens:
while self._match_set(prefix_tokens):
prefix += self._prev.text

if (any_token and self._advance_any()) or self._match_set(tokens or self.ID_VAR_TOKENS):
quoted = self._prev.token_type == TokenType.STRING
return exp.Identifier(this=prefix + self._prev.text, quoted=quoted)
return exp.Identifier(this=self._prev.text, quoted=quoted)

return None

Expand Down

0 comments on commit a30a828

Please sign in to comment.