Skip to content

Commit

Permalink
Handle special case with space-delimited parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtemple committed Jan 15, 2024
1 parent ff64156 commit ed6d8e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lkml/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@ def parse_value(

if self.check(tokens.LiteralToken):
token = self.consume()
# Handle special case where a hyphen can be preceded by whitspace
if token.value == "-" and self.consume_trivia():
if self.check(tokens.LiteralToken):
token = self.consume()
token.value = "-" + token.value
else:
return None
suffix = self.consume_trivia() if parse_suffix else ""
if self.log_debug:
logger.debug("%sSuccessfully parsed value.", self.depth * DELIMITER)
Expand Down

0 comments on commit ed6d8e4

Please sign in to comment.