Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support binary format of integers, e.g. 0b00101 #114

Closed
wants to merge 1 commit into from

Conversation

p4l1ly
Copy link

@p4l1ly p4l1ly commented Sep 24, 2018

implements feature #113

@chyh1990
Copy link
Owner

chyh1990 commented Mar 6, 2019

According to the yaml 1.1 spec, https://yaml.org/type/int.html

Integer can use binary representation and can contain separator _.

But according to 1.2 spec, binary representation of integer seems to be deprecated,

1.2 spec (section 10.3. Core Schema) lists only three regex format for int type:

[-+]? [0-9]+ | tag:yaml.org,2002:int (Base 10)
-- | --
0o [0-7]+ | tag:yaml.org,2002:int (Base 8)
0x [0-9a-fA-F]+ | tag:yaml.org,2002:int (Base 16)

so in 1.2, 0b0101 should be interpreted as string, instead of int. This library is designed for yaml 1.2, so current behavior is expected and should be kept.

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.

None yet

2 participants