Skip to content

Commit 82487e6

Browse files
localai-botmudler
andauthored
fix(grammars): restore backslash escaping in llama31 grammar fixture (#11242)
PR #11041 rewrote the testllama31inputResult1 fixture and un-escaped the backslashes inside its Go raw-string literal, turning `[^"\\]` into `[^"\]` and `["\\/bfnrt]` into `["\/bfnrt]`. The fixture is compared line-by-line against the grammar built from PRIMITIVE_RULES in bnf_rules.go, which is unchanged and still emits the doubled form, so "generates a valid grammar from JSON schema" fails on every platform. Restore the four fixture lines to their pre-#11041 form. The cyclic $ref and depth specs added by that PR are untouched. The regression reached master because only the DCO check ever reported on #11041; its test runs were cancelled during the CI purge. Assisted-by: Claude Code:claude-opus-5[1m] [Bash] [Edit] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 5c2099f commit 82487e6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/functions/grammars/llama31_schema_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const (
4343
// <function=example_function_name>{{"example_name": "example_value"}}</function>
4444
testllama31inputResult1 = `root-0-function ::= "create_event"
4545
freestring ::= (
46-
[^"\] |
47-
"\\" (["\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F])
46+
[^"\\] |
47+
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F])
4848
)* space
4949
root-0 ::= "<function=" root-0-function ">{" root-0-arguments "}</function>"
5050
root-1-arguments ::= "{" space "\"query\"" space ":" space string "}" space
@@ -53,8 +53,8 @@ space ::= " "?
5353
root-0-arguments ::= "{" space "\"date\"" space ":" space string "," space "\"time\"" space ":" space string "," space "\"title\"" space ":" space string "}" space
5454
root-1 ::= "<function=" root-1-function ">{" root-1-arguments "}</function>"
5555
string ::= "\"" (
56-
[^"\] |
57-
"\\" (["\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F])
56+
[^"\\] |
57+
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F])
5858
)* "\"" space
5959
root-1-function ::= "search"`
6060
)

0 commit comments

Comments
 (0)