%TAG prefix does not accept all characters in ns-uri-char production
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.2k
- Forks
- 370
- PR merge metrics
- No merged PRs in 30d
Description
As noted in https://github.com/yaml/yaml-spec/issues/268#issuecomment-1208565027, Psych does not accept a %TAG prefix including a #, which seems to be due to the following code:
According to theYAML 1.2 Spec the ns-uri-char does include #, which is missing from the scanner.
[39] ns-uri-char ::=
(
'%'
[ns-hex-digit](https://yaml.org/spec/1.2.2/#rule-ns-hex-digit){2}
)
| [ns-word-char](https://yaml.org/spec/1.2.2/#rule-ns-word-char)
| '#'
| ';'
| '/'
| '?'
| ':'
| '@'
| '&'
| '='
| '+'
| '$'
| ','
| '_'
| '.'
| '!'
| '~'
| '*'
| "'"
| '('
| ')'
| '['
| ']'
This prevents creating a TAG line such as the following:
%TAG ! http://www.w3.org/2001/XMLSchema#
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/scanner.c at the linked lines 2603-2627, where the %TAG prefix characters are scanned. Check the YAML 1.2 ns-uri-char production and verify that the example prefix ending in # is accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100