Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/test_everything.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ complex_anchor_chains:
final:
<<: *derived2 # Final merge
final: value3

# Complex string
config:
where: '{{ "my_column != date ''2025-08-31''" if target.name == ''prod'' else ''1=1'' }}'
13 changes: 12 additions & 1 deletion yamlium/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,18 @@ def _parse_quoted_scalar(self) -> list[Token]:
quote_char = self.c
self._nc()
char = self.c
while char != quote_char:
while True:
if char == quote_char:
# Check if this is an escaped quote (two consecutive quotes)
if quote_char == "'" and self.c_future == "'":
# Skip both quotes - this is an escaped single quote
self._nc() # Skip first quote
self._nc() # Skip second quote
char = self.c
continue
else:
# Found the closing quote
break
if char == "\n":
# In YAML, quoted strings can span multiple lines
# Track the newline for proper line/column tracking
Expand Down