diff options
author | Kevin Newton <kddnewton@gmail.com> | 2024-05-08 15:32:24 -0400 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2024-05-21 14:27:46 -0400 |
commit | 89efb94fec9c78caab7ec4079bfe9e3f4e56a9a4 (patch) | |
tree | 7dd8b635def05ffa9b8bc15d4805c792b00dad22 /test/prism/snapshots/whitequark/complex.txt | |
parent | 42930d28a48bf7495180e81fd6e5cf742f3f47c7 (diff) |
[ruby/prism] Reconfigure rationals
This eliminates the subnode on RationalNode and replaces it with two
integer fields, which represent the ratio for the rational. It also
reduces those two integers if they both fit into 32 bits.
Importantly, this PR does not implement bignum reduction. That's something
I'd like to consider for the future, but it's simple enough for now to
leave them unreduced, which makes it more useful than it used to be.
https://github.com/ruby/prism/commit/86e06c7068
Diffstat (limited to 'test/prism/snapshots/whitequark/complex.txt')
-rw-r--r-- | test/prism/snapshots/whitequark/complex.txt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/prism/snapshots/whitequark/complex.txt b/test/prism/snapshots/whitequark/complex.txt index e688585a5f..bc748db09b 100644 --- a/test/prism/snapshots/whitequark/complex.txt +++ b/test/prism/snapshots/whitequark/complex.txt @@ -10,9 +10,9 @@ ├── @ ImaginaryNode (location: (3,0)-(3,6)) │ └── numeric: │ @ RationalNode (location: (3,0)-(3,5)) - │ └── numeric: - │ @ FloatNode (location: (3,0)-(3,4)) - │ └── value: 42.1 + │ ├── flags: decimal + │ ├── numerator: 421 + │ └── denominator: 10 ├── @ ImaginaryNode (location: (5,0)-(5,3)) │ └── numeric: │ @ IntegerNode (location: (5,0)-(5,2)) @@ -21,7 +21,6 @@ └── @ ImaginaryNode (location: (7,0)-(7,4)) └── numeric: @ RationalNode (location: (7,0)-(7,3)) - └── numeric: - @ IntegerNode (location: (7,0)-(7,2)) - ├── flags: decimal - └── value: 42 + ├── flags: decimal + ├── numerator: 42 + └── denominator: 1 |