mirror of
https://github.com/valitydev/yamerl.git
synced 2024-11-06 02:45:23 +00:00
The "0o" prefix is only supported by YAML 1.2 integer spec
In the Types repository, the prefix for base 8 is "0" only.
This commit is contained in:
parent
781b27791e
commit
e65bda25db
@ -88,13 +88,11 @@ string_to_integer2("0b" ++ Text) ->
|
||||
base2_to_integer(Text, 0);
|
||||
string_to_integer2("0x" ++ Text) ->
|
||||
base16_to_integer(Text, 0);
|
||||
string_to_integer2("0o" ++ Text) ->
|
||||
base8_to_integer(Text, 0);
|
||||
string_to_integer2("0" ++ Text) ->
|
||||
base8_to_integer(Text, 0);
|
||||
string_to_integer2(Text) ->
|
||||
Opts = [{capture, none}],
|
||||
case re:run(Text, "[1-9][0-9_]*(?::[0-5]?[0-9])+", Opts) of
|
||||
case re:run(Text, "[1-9][0-9_]*(:[0-5]?[0-9])+", Opts) of
|
||||
match -> base60_to_integer(Text, 0, 0);
|
||||
nomatch -> base10_to_integer(Text, 0)
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user