load_yaml: Fix include spec parsing of pipes
_INCLUDE_PATH_RE allows the pipe character in the target-path part of a jw.include spec such as 'target.path|file.yaml'. The greedy match then consumes further pipes, so a file name that itself contains a pipe is misparsed: the target swallows part of the file name and the remainder becomes the (nonexistent) file to open. Dots are needed in the target part for nested paths, but a pipe can never be part of a target path. Drop the pipe from the character class so that the first pipe always separates the target path from the file name. Add a regression test with a pipe in the file name. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
1fd3c75c08
commit
e6f3833716
1 changed files with 12 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ IncludeSpec: TypeAlias = tuple[bool, Path, tuple[str, ...]]
|
|||
Includes: TypeAlias = list[IncludeSpec]
|
||||
|
||||
_LINK_NAME_RE = re.compile(r'^([a-zA-Z0-9_-]+)\|')
|
||||
_INCLUDE_PATH_RE = re.compile(r'^([a-zA-Z0-9_.|-]+)\|')
|
||||
_INCLUDE_PATH_RE = re.compile(r'^([a-zA-Z0-9_.-]+)\|')
|
||||
|
||||
# -- Low-level helpers (call graph leaves) --------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue