Skip to content

The anchor can be unicode char#21

Open
cloudwu wants to merge 1 commit intoyaml:masterfrom
cloudwu:master
Open

The anchor can be unicode char#21
cloudwu wants to merge 1 commit intoyaml:masterfrom
cloudwu:master

Conversation

@cloudwu
Copy link
Copy Markdown

@cloudwu cloudwu commented Oct 14, 2016

For yaml 1.1 sepc, anchor name can be any unicode char (http://yaml.org/spec/1.1/#id899912)

[109]   ns-anchor-name  ::= ns-char+
[38]    ns-char ::= nb-char - s-white
[34]    nb-char ::= c-printable - b-char

@sigmavirus24
Copy link
Copy Markdown
Contributor

@ingydotnet this looks fine to me, do you have opinions? Also, do you know why Travis isn't running against these PRs?

@cloudwu
Copy link
Copy Markdown
Author

cloudwu commented Oct 18, 2016

sorry, I forgot ignore the white space at first. so I update the PR .

@cloudwu
Copy link
Copy Markdown
Author

cloudwu commented Nov 29, 2016

I found another bug.

[1:0]

This is a valid yaml document, but libyaml report found unexpected ':'

1:0 is a sexagesimal . See http://yaml.org/spec/1.1/ Example 2.19. Integers

canonical: 12345
decimal: +12,345
sexagesimal: 3:25:45
octal: 014
hexadecimal: 0xC

@cloudwu cloudwu changed the title The anchor can be unicode char The anchor can be unicode char & support sexagesimal Nov 30, 2016
@ingydotnet
Copy link
Copy Markdown
Member

I'd like to see tests added for these things.

We might want to split this into 2 PRs.

URLs are probably a more common reason for ':' in plain scalar, than
sexagesimal. (I want to drop sexagesimal as a suggested default behavior in
1.3).

Failing tests:

Unicode anchors:

foo: &döt
  bar: 123
baz: *döt

Colon in flow plain:

key: {url: http://example.com}

@cloudwu cloudwu changed the title The anchor can be unicode char & support sexagesimal The anchor can be unicode char Dec 3, 2016
@cloudwu
Copy link
Copy Markdown
Author

cloudwu commented Dec 3, 2016

I remove the last commit just now , and would make a new pr for ':' in plain scalar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants