-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change String#to_i to parse octals with prefix 0o (#7691)
* Change String#to_i to parse octals with prefix 0o This is a breaking change. Previously, numbers starting with 0 would be parsed as octals. A previous change in Crystal requires octals start with 0o. Now that is not the case, and they will be parsed as base-10. The 0o prefix must be present to treat it as an octal. This addresses parsing 0 with prefix: true raising an error. Additionally, YAML parsing used the old style. This updates the spec to handle the new parsing. There is no official documentation for YAML (that I'm aware of) for octals. * Add leading_zero_is_octal to String#to_i variations This allows parsing of octals in strings that use just 0 as a prefix instead of 0o. When this flag is true, the prior behavior for parsing octals is used. YAML parsing has been updated to accept 0 and 0o prefixes for octals. * Resolve merge issues with b1666f2
- Loading branch information
1 parent
c740506
commit cae08eb
Showing
4 changed files
with
88 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters