Parser modification to handle negative integer edge cases #121
No reviewers
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#121
Loading…
Reference in New Issue
No description provided.
Delete Branch "integer_range_fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The original python parser parses things like
-2147483648
to beThis will cause problem of
Integer out of bound
at edge cases when a signed integer is the smallest one in its range. E.g.,i32
ranges from-2147483648
to2147483647
, when we have a i32 literal-2147483648
, the current parser will cause the type system to try get the type of2147483648
, which is not in i32, and hence the error.There might be some other ways to handle this edge case without touching the parser, but I personally think to modify the parser would be adequate if I did not miss anything. Thanks!
Modify the parser to handle negative integer edge casesto Parser modification to handle negative integer edge casesDo you know why it was done that way in RustPython?
I think it does this way just to be consistent with original python where
int
has no size restriction: