Skip to content

Syntax errors for invalid 128-bit integer literals#10975

Merged
straight-shoota merged 7 commits intocrystal-lang:masterfrom
rymiel:128integers
Aug 23, 2021
Merged

Syntax errors for invalid 128-bit integer literals#10975
straight-shoota merged 7 commits intocrystal-lang:masterfrom
rymiel:128integers

Conversation

@rymiel
Copy link
Contributor

@rymiel rymiel commented Jul 20, 2021

Fixes #10962

Since I am not skilled enough to resolve these TODOs in the codegen, I simply opted to warn about not being allowed to use literals larger than a 64-bit integer

when :i128
# TODO: implement String#to_i128 and use it
@last = int128(node.value.to_i64)
when :u128
# TODO: implement String#to_u128 and use it
@last = int128(node.value.to_u64)

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser labels Jul 20, 2021
@straight-shoota
Copy link
Member

Thanks. Parser warnings are really fine for now. Full 128-bit support is a more complex story (#8373).

Copy link
Contributor

@Sija Sija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing indentation suggestions.

Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
@rymiel rymiel requested a review from straight-shoota July 24, 2021 20:06
Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @rymiel 🙏

@straight-shoota straight-shoota added this to the 1.2.0 milestone Aug 14, 2021
@straight-shoota straight-shoota merged commit e9ff06b into crystal-lang:master Aug 23, 2021
BlobCodes added a commit to BlobCodes/crystal that referenced this pull request Aug 24, 2021
@rymiel rymiel deleted the 128integers branch September 2, 2021 11:22
@BlobCodes BlobCodes mentioned this pull request Sep 9, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when compiling negative u128 constants

4 participants