Skip to content

jinja: support hexadecimal string escapes - #30929

Merged
danbev merged 1 commit into
ggml-org:masterfrom
alexey-rsi:jinja-hex-escapes
Oct 21, 2026
Merged

danbev merged 1 commit into
ggml-org:masterfrom
alexey-rsi:jinja-hex-escapes

Conversation

@alexey-rsi

Copy link
Copy Markdown
Contributor

Overview

Support Python Jinja's \xHH escapes in string literals, including templates that remove NUL characters with replace("\x00", ""). Escapes consume exactly two hexadecimal digits and encode the character as UTF-8; invalid or incomplete escapes produce a lexer error.

Additional information

  • test-jinja: 1,504 assertions pass, zero failures; eight tests skipped.
  • Regressions cover NUL removal, non-ASCII escapes, exactly two hex digits, escaped backslashes, and malformed escapes.
  • All 256 values with uppercase/lowercase hex digits and 551 full-template rendering cases match Python Jinja. Both implementations reject the nine malformed cases checked.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES. Codex substantially assisted implementation, review, testing. Code has been manually reviewed and the PR description has been written manually.

@ggml-gh-bot

This comment was marked as resolved.

@CISC CISC added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Oct 21, 2026
@github-actions github-actions Bot added testing Everything test related jinja parser Issues related to the jinja parser labels Oct 21, 2026
@danbev
danbev merged commit 9febe63 into ggml-org:master Oct 21, 2026
14 checks passed
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 24, 2026
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jinja parser Issues related to the jinja parser merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants