13514
|
1 /*
|
|
2 * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. This
|
|
3 * code is released under a tri EPL/GPL/LGPL license. You can use it,
|
|
4 * redistribute it and/or modify it under the terms of the:
|
|
5 *
|
|
6 * Eclipse Public License version 1.0
|
|
7 * GNU General Public License version 2
|
|
8 * GNU Lesser General Public License version 2.1
|
|
9 */
|
|
10 package com.oracle.truffle.ruby.nodes.core;
|
|
11
|
|
12 import java.math.*;
|
|
13
|
|
14 import com.oracle.truffle.api.*;
|
|
15 import com.oracle.truffle.api.dsl.*;
|
|
16 import com.oracle.truffle.api.frame.*;
|
|
17 import com.oracle.truffle.ruby.runtime.*;
|
|
18 import com.oracle.truffle.ruby.runtime.core.*;
|
|
19 import com.oracle.truffle.ruby.runtime.core.array.*;
|
|
20
|
|
21 @CoreClass(name = "Bignum")
|
|
22 public abstract class BignumNodes {
|
|
23
|
|
24 @CoreMethod(names = "+@", maxArgs = 0)
|
|
25 public abstract static class PosNode extends CoreMethodNode {
|
|
26
|
|
27 public PosNode(RubyContext context, SourceSection sourceSection) {
|
|
28 super(context, sourceSection);
|
|
29 }
|
|
30
|
|
31 public PosNode(PosNode prev) {
|
|
32 super(prev);
|
|
33 }
|
|
34
|
|
35 @Specialization
|
|
36 public BigInteger pos(BigInteger value) {
|
|
37 return value;
|
|
38 }
|
|
39
|
|
40 }
|
|
41
|
|
42 @CoreMethod(names = "-@", maxArgs = 0)
|
|
43 public abstract static class NegNode extends CoreMethodNode {
|
|
44
|
|
45 public NegNode(RubyContext context, SourceSection sourceSection) {
|
|
46 super(context, sourceSection);
|
|
47 }
|
|
48
|
|
49 public NegNode(NegNode prev) {
|
|
50 super(prev);
|
|
51 }
|
|
52
|
|
53 @Specialization
|
|
54 public BigInteger neg(BigInteger value) {
|
|
55 return value.negate();
|
|
56 }
|
|
57
|
|
58 }
|
|
59
|
|
60 @CoreMethod(names = "+", minArgs = 1, maxArgs = 1)
|
|
61 public abstract static class AddNode extends CoreMethodNode {
|
|
62
|
|
63 public AddNode(RubyContext context, SourceSection sourceSection) {
|
|
64 super(context, sourceSection);
|
|
65 }
|
|
66
|
|
67 public AddNode(AddNode prev) {
|
|
68 super(prev);
|
|
69 }
|
|
70
|
|
71 @Specialization
|
|
72 public Object add(BigInteger a, int b) {
|
|
73 return a.add(BigInteger.valueOf(b));
|
|
74 }
|
|
75
|
|
76 @Specialization
|
|
77 public double add(BigInteger a, double b) {
|
|
78 return a.doubleValue() + b;
|
|
79 }
|
|
80
|
|
81 @Specialization
|
|
82 public Object add(BigInteger a, BigInteger b) {
|
|
83 return GeneralConversions.fixnumOrBignum(a.add(b));
|
|
84 }
|
|
85
|
|
86 }
|
|
87
|
|
88 @CoreMethod(names = "-", minArgs = 1, maxArgs = 1)
|
|
89 public abstract static class SubNode extends CoreMethodNode {
|
|
90
|
|
91 public SubNode(RubyContext context, SourceSection sourceSection) {
|
|
92 super(context, sourceSection);
|
|
93 }
|
|
94
|
|
95 public SubNode(SubNode prev) {
|
|
96 super(prev);
|
|
97 }
|
|
98
|
|
99 @Specialization
|
|
100 public Object sub(BigInteger a, int b) {
|
|
101 return a.subtract(BigInteger.valueOf(b));
|
|
102 }
|
|
103
|
|
104 @Specialization
|
|
105 public double sub(BigInteger a, double b) {
|
|
106 return a.doubleValue() - b;
|
|
107 }
|
|
108
|
|
109 @Specialization
|
|
110 public Object sub(BigInteger a, BigInteger b) {
|
|
111 return GeneralConversions.fixnumOrBignum(a.subtract(b));
|
|
112 }
|
|
113
|
|
114 }
|
|
115
|
|
116 @CoreMethod(names = "*", minArgs = 1, maxArgs = 1)
|
|
117 public abstract static class MulNode extends CoreMethodNode {
|
|
118
|
|
119 public MulNode(RubyContext context, SourceSection sourceSection) {
|
|
120 super(context, sourceSection);
|
|
121 }
|
|
122
|
|
123 public MulNode(MulNode prev) {
|
|
124 super(prev);
|
|
125 }
|
|
126
|
|
127 @Specialization
|
|
128 public Object mul(BigInteger a, int b) {
|
|
129 return a.multiply(BigInteger.valueOf(b));
|
|
130 }
|
|
131
|
|
132 @Specialization
|
|
133 public double mul(BigInteger a, double b) {
|
|
134 return a.doubleValue() * b;
|
|
135 }
|
|
136
|
|
137 @Specialization
|
|
138 public Object mul(BigInteger a, BigInteger b) {
|
|
139 return GeneralConversions.fixnumOrBignum(a.multiply(b));
|
|
140 }
|
|
141
|
|
142 }
|
|
143
|
|
144 @CoreMethod(names = "**", minArgs = 1, maxArgs = 1)
|
|
145 public abstract static class PowNode extends CoreMethodNode {
|
|
146
|
|
147 public PowNode(RubyContext context, SourceSection sourceSection) {
|
|
148 super(context, sourceSection);
|
|
149 }
|
|
150
|
|
151 public PowNode(PowNode prev) {
|
|
152 super(prev);
|
|
153 }
|
|
154
|
|
155 @Specialization
|
|
156 public BigInteger pow(BigInteger a, int b) {
|
|
157 return a.pow(b);
|
|
158 }
|
|
159
|
|
160 @Specialization
|
|
161 public double pow(BigInteger a, double b) {
|
|
162 return Math.pow(a.doubleValue(), b);
|
|
163 }
|
|
164
|
|
165 @Specialization
|
|
166 public BigInteger pow(BigInteger a, BigInteger b) {
|
|
167 BigInteger result = BigInteger.ONE;
|
|
168
|
|
169 for (BigInteger n = BigInteger.ZERO; b.compareTo(b) < 0; n = n.add(BigInteger.ONE)) {
|
|
170 result = result.multiply(a);
|
|
171 }
|
|
172
|
|
173 return result;
|
|
174 }
|
|
175
|
|
176 }
|
|
177
|
|
178 @CoreMethod(names = "/", minArgs = 1, maxArgs = 1)
|
|
179 public abstract static class DivNode extends CoreMethodNode {
|
|
180
|
|
181 public DivNode(RubyContext context, SourceSection sourceSection) {
|
|
182 super(context, sourceSection);
|
|
183 }
|
|
184
|
|
185 public DivNode(DivNode prev) {
|
|
186 super(prev);
|
|
187 }
|
|
188
|
|
189 @Specialization
|
|
190 public Object div(BigInteger a, int b) {
|
|
191 return a.divide(BigInteger.valueOf(b));
|
|
192 }
|
|
193
|
|
194 @Specialization
|
|
195 public double div(BigInteger a, double b) {
|
|
196 return a.doubleValue() / b;
|
|
197 }
|
|
198
|
|
199 @Specialization
|
|
200 public Object div(BigInteger a, BigInteger b) {
|
|
201 return GeneralConversions.fixnumOrBignum(a.divide(b));
|
|
202 }
|
|
203
|
|
204 }
|
|
205
|
|
206 @CoreMethod(names = "%", minArgs = 1, maxArgs = 1)
|
|
207 public abstract static class ModNode extends CoreMethodNode {
|
|
208
|
|
209 public ModNode(RubyContext context, SourceSection sourceSection) {
|
|
210 super(context, sourceSection);
|
|
211 }
|
|
212
|
|
213 public ModNode(ModNode prev) {
|
|
214 super(prev);
|
|
215 }
|
|
216
|
|
217 @Specialization
|
|
218 public Object mod(BigInteger a, int b) {
|
|
219 return GeneralConversions.fixnumOrBignum(a.mod(BigInteger.valueOf(b)));
|
|
220 }
|
|
221
|
|
222 @Specialization
|
|
223 public Object mod(@SuppressWarnings("unused") BigInteger a, @SuppressWarnings("unused") double b) {
|
|
224 throw new UnsupportedOperationException();
|
|
225 }
|
|
226
|
|
227 @Specialization
|
|
228 public Object mod(BigInteger a, BigInteger b) {
|
|
229 return GeneralConversions.fixnumOrBignum(a.mod(b));
|
|
230 }
|
|
231
|
|
232 }
|
|
233
|
|
234 @CoreMethod(names = "divmod", minArgs = 1, maxArgs = 1)
|
|
235 public abstract static class DivModNode extends CoreMethodNode {
|
|
236
|
|
237 public DivModNode(RubyContext context, SourceSection sourceSection) {
|
|
238 super(context, sourceSection);
|
|
239 }
|
|
240
|
|
241 public DivModNode(DivModNode prev) {
|
|
242 super(prev);
|
|
243 }
|
|
244
|
|
245 @SuppressWarnings("unused")
|
|
246 @Specialization
|
|
247 public RubyArray divMod(VirtualFrame frame, BigInteger a, int b) {
|
|
248 return RubyBignum.divMod(getContext(), a, BigInteger.valueOf(b));
|
|
249 }
|
|
250
|
|
251 @Specialization
|
|
252 public RubyArray divMod(@SuppressWarnings("unused") BigInteger a, @SuppressWarnings("unused") double b) {
|
|
253 throw new UnsupportedOperationException();
|
|
254 }
|
|
255
|
|
256 @Specialization
|
|
257 public RubyArray divMod(BigInteger a, BigInteger b) {
|
|
258 return RubyBignum.divMod(getContext(), a, b);
|
|
259 }
|
|
260
|
|
261 }
|
|
262
|
|
263 @CoreMethod(names = "<", minArgs = 1, maxArgs = 1)
|
|
264 public abstract static class LessNode extends CoreMethodNode {
|
|
265
|
|
266 public LessNode(RubyContext context, SourceSection sourceSection) {
|
|
267 super(context, sourceSection);
|
|
268 }
|
|
269
|
|
270 public LessNode(LessNode prev) {
|
|
271 super(prev);
|
|
272 }
|
|
273
|
|
274 @Specialization
|
|
275 public boolean less(BigInteger a, int b) {
|
|
276 return a.compareTo(BigInteger.valueOf(b)) < 0;
|
|
277 }
|
|
278
|
|
279 @Specialization
|
|
280 public boolean less(BigInteger a, double b) {
|
|
281 return a.compareTo(BigInteger.valueOf((long) b)) < 0;
|
|
282 }
|
|
283
|
|
284 @Specialization
|
|
285 public boolean less(BigInteger a, BigInteger b) {
|
|
286 return a.compareTo(b) < 0;
|
|
287 }
|
|
288 }
|
|
289
|
|
290 @CoreMethod(names = "<=", minArgs = 1, maxArgs = 1)
|
|
291 public abstract static class LessEqualNode extends CoreMethodNode {
|
|
292
|
|
293 public LessEqualNode(RubyContext context, SourceSection sourceSection) {
|
|
294 super(context, sourceSection);
|
|
295 }
|
|
296
|
|
297 public LessEqualNode(LessEqualNode prev) {
|
|
298 super(prev);
|
|
299 }
|
|
300
|
|
301 @Specialization
|
|
302 public boolean lessEqual(BigInteger a, int b) {
|
|
303 return a.compareTo(BigInteger.valueOf(b)) <= 0;
|
|
304 }
|
|
305
|
|
306 @Specialization
|
|
307 public boolean lessEqual(BigInteger a, double b) {
|
|
308 return a.compareTo(BigInteger.valueOf((long) b)) <= 0;
|
|
309 }
|
|
310
|
|
311 @Specialization
|
|
312 public boolean lessEqual(BigInteger a, BigInteger b) {
|
|
313 return a.compareTo(b) <= 0;
|
|
314 }
|
|
315 }
|
|
316
|
|
317 @CoreMethod(names = "==", minArgs = 1, maxArgs = 1)
|
|
318 public abstract static class EqualNode extends CoreMethodNode {
|
|
319
|
|
320 public EqualNode(RubyContext context, SourceSection sourceSection) {
|
|
321 super(context, sourceSection);
|
|
322 }
|
|
323
|
|
324 public EqualNode(EqualNode prev) {
|
|
325 super(prev);
|
|
326 }
|
|
327
|
|
328 @Specialization
|
|
329 public boolean equal(BigInteger a, int b) {
|
|
330 return a.compareTo(BigInteger.valueOf(b)) == 0;
|
|
331 }
|
|
332
|
|
333 @Specialization
|
|
334 public boolean equal(BigInteger a, double b) {
|
|
335 return a.compareTo(BigInteger.valueOf((long) b)) == 0;
|
|
336 }
|
|
337
|
|
338 @Specialization
|
|
339 public boolean equal(BigInteger a, BigInteger b) {
|
|
340 return a.compareTo(b) == 0;
|
|
341 }
|
|
342 }
|
|
343
|
|
344 @CoreMethod(names = "<=>", minArgs = 1, maxArgs = 1)
|
|
345 public abstract static class CompareNode extends CoreMethodNode {
|
|
346
|
|
347 public CompareNode(RubyContext context, SourceSection sourceSection) {
|
|
348 super(context, sourceSection);
|
|
349 }
|
|
350
|
|
351 public CompareNode(CompareNode prev) {
|
|
352 super(prev);
|
|
353 }
|
|
354
|
|
355 @Specialization
|
|
356 public int compare(BigInteger a, int b) {
|
|
357 return a.compareTo(BigInteger.valueOf(b));
|
|
358 }
|
|
359
|
|
360 @Specialization
|
|
361 public int compare(BigInteger a, double b) {
|
|
362 return a.compareTo(BigInteger.valueOf((long) b));
|
|
363 }
|
|
364
|
|
365 @Specialization
|
|
366 public int compare(BigInteger a, BigInteger b) {
|
|
367 return a.compareTo(b);
|
|
368 }
|
|
369 }
|
|
370
|
|
371 @CoreMethod(names = "!=", minArgs = 1, maxArgs = 1)
|
|
372 public abstract static class NotEqualNode extends CoreMethodNode {
|
|
373
|
|
374 public NotEqualNode(RubyContext context, SourceSection sourceSection) {
|
|
375 super(context, sourceSection);
|
|
376 }
|
|
377
|
|
378 public NotEqualNode(NotEqualNode prev) {
|
|
379 super(prev);
|
|
380 }
|
|
381
|
|
382 @Specialization
|
|
383 public boolean notEqual(BigInteger a, int b) {
|
|
384 return a.compareTo(BigInteger.valueOf(b)) != 0;
|
|
385 }
|
|
386
|
|
387 @Specialization
|
|
388 public boolean notEqual(BigInteger a, double b) {
|
|
389 return a.compareTo(BigInteger.valueOf((long) b)) != 0;
|
|
390 }
|
|
391
|
|
392 @Specialization
|
|
393 public boolean notEqual(BigInteger a, BigInteger b) {
|
|
394 return a.compareTo(b) != 0;
|
|
395 }
|
|
396 }
|
|
397
|
|
398 @CoreMethod(names = ">=", minArgs = 1, maxArgs = 1)
|
|
399 public abstract static class GreaterEqualNode extends CoreMethodNode {
|
|
400
|
|
401 public GreaterEqualNode(RubyContext context, SourceSection sourceSection) {
|
|
402 super(context, sourceSection);
|
|
403 }
|
|
404
|
|
405 public GreaterEqualNode(GreaterEqualNode prev) {
|
|
406 super(prev);
|
|
407 }
|
|
408
|
|
409 @Specialization
|
|
410 public boolean greaterEqual(BigInteger a, int b) {
|
|
411 return a.compareTo(BigInteger.valueOf(b)) >= 0;
|
|
412 }
|
|
413
|
|
414 @Specialization
|
|
415 public boolean greaterEqual(BigInteger a, double b) {
|
|
416 return a.compareTo(BigInteger.valueOf((long) b)) >= 0;
|
|
417 }
|
|
418
|
|
419 @Specialization
|
|
420 public boolean greaterEqual(BigInteger a, BigInteger b) {
|
|
421 return a.compareTo(b) >= 0;
|
|
422 }
|
|
423 }
|
|
424
|
|
425 @CoreMethod(names = ">", minArgs = 1, maxArgs = 1)
|
|
426 public abstract static class GreaterNode extends CoreMethodNode {
|
|
427
|
|
428 public GreaterNode(RubyContext context, SourceSection sourceSection) {
|
|
429 super(context, sourceSection);
|
|
430 }
|
|
431
|
|
432 public GreaterNode(GreaterNode prev) {
|
|
433 super(prev);
|
|
434 }
|
|
435
|
|
436 @Specialization
|
|
437 public boolean equal(BigInteger a, int b) {
|
|
438 return a.compareTo(BigInteger.valueOf(b)) > 0;
|
|
439 }
|
|
440
|
|
441 @Specialization
|
|
442 public boolean equal(BigInteger a, double b) {
|
|
443 return a.compareTo(BigInteger.valueOf((long) b)) > 0;
|
|
444 }
|
|
445
|
|
446 @Specialization
|
|
447 public boolean equal(BigInteger a, BigInteger b) {
|
|
448 return a.compareTo(b) > 0;
|
|
449 }
|
|
450 }
|
|
451
|
|
452 @CoreMethod(names = "&", minArgs = 1, maxArgs = 1)
|
|
453 public abstract static class BitAndNode extends CoreMethodNode {
|
|
454
|
|
455 public BitAndNode(RubyContext context, SourceSection sourceSection) {
|
|
456 super(context, sourceSection);
|
|
457 }
|
|
458
|
|
459 public BitAndNode(BitAndNode prev) {
|
|
460 super(prev);
|
|
461 }
|
|
462
|
|
463 @Specialization
|
|
464 public Object bitAnd(BigInteger a, int b) {
|
|
465 return GeneralConversions.fixnumOrBignum(a.and(BigInteger.valueOf(b)));
|
|
466 }
|
|
467
|
|
468 @Specialization
|
|
469 public Object bitAnd(BigInteger a, BigInteger b) {
|
|
470 return GeneralConversions.fixnumOrBignum(a.and(b));
|
|
471 }
|
|
472 }
|
|
473
|
|
474 @CoreMethod(names = "|", minArgs = 1, maxArgs = 1)
|
|
475 public abstract static class BitOrNode extends CoreMethodNode {
|
|
476
|
|
477 public BitOrNode(RubyContext context, SourceSection sourceSection) {
|
|
478 super(context, sourceSection);
|
|
479 }
|
|
480
|
|
481 public BitOrNode(BitOrNode prev) {
|
|
482 super(prev);
|
|
483 }
|
|
484
|
|
485 @Specialization
|
|
486 public Object bitOr(BigInteger a, int b) {
|
|
487 return GeneralConversions.fixnumOrBignum(a.or(BigInteger.valueOf(b)));
|
|
488 }
|
|
489
|
|
490 @Specialization
|
|
491 public Object bitOr(BigInteger a, BigInteger b) {
|
|
492 return GeneralConversions.fixnumOrBignum(a.or(b));
|
|
493 }
|
|
494 }
|
|
495
|
|
496 @CoreMethod(names = "^", minArgs = 1, maxArgs = 1)
|
|
497 public abstract static class BitXOrNode extends CoreMethodNode {
|
|
498
|
|
499 public BitXOrNode(RubyContext context, SourceSection sourceSection) {
|
|
500 super(context, sourceSection);
|
|
501 }
|
|
502
|
|
503 public BitXOrNode(BitXOrNode prev) {
|
|
504 super(prev);
|
|
505 }
|
|
506
|
|
507 @Specialization
|
|
508 public Object bitXOr(BigInteger a, int b) {
|
|
509 return GeneralConversions.fixnumOrBignum(a.xor(BigInteger.valueOf(b)));
|
|
510 }
|
|
511
|
|
512 @Specialization
|
|
513 public Object bitXOr(BigInteger a, BigInteger b) {
|
|
514 return GeneralConversions.fixnumOrBignum(a.xor(b));
|
|
515 }
|
|
516 }
|
|
517
|
|
518 @CoreMethod(names = "<<", minArgs = 1, maxArgs = 1)
|
|
519 public abstract static class LeftShiftNode extends CoreMethodNode {
|
|
520
|
|
521 public LeftShiftNode(RubyContext context, SourceSection sourceSection) {
|
|
522 super(context, sourceSection);
|
|
523 }
|
|
524
|
|
525 public LeftShiftNode(LeftShiftNode prev) {
|
|
526 super(prev);
|
|
527 }
|
|
528
|
|
529 @Specialization
|
|
530 public Object leftShift(BigInteger a, int b) {
|
|
531 if (b >= 0) {
|
|
532 return GeneralConversions.fixnumOrBignum(a.shiftLeft(b));
|
|
533 } else {
|
|
534 return GeneralConversions.fixnumOrBignum(a.shiftRight(-b));
|
|
535 }
|
|
536 }
|
|
537
|
|
538 }
|
|
539
|
|
540 @CoreMethod(names = ">>", minArgs = 1, maxArgs = 1)
|
|
541 public abstract static class RightShiftNode extends CoreMethodNode {
|
|
542
|
|
543 public RightShiftNode(RubyContext context, SourceSection sourceSection) {
|
|
544 super(context, sourceSection);
|
|
545 }
|
|
546
|
|
547 public RightShiftNode(RightShiftNode prev) {
|
|
548 super(prev);
|
|
549 }
|
|
550
|
|
551 @Specialization
|
|
552 public Object leftShift(BigInteger a, int b) {
|
|
553 if (b >= 0) {
|
|
554 return GeneralConversions.fixnumOrBignum(a.shiftRight(b));
|
|
555 } else {
|
|
556 return GeneralConversions.fixnumOrBignum(a.shiftLeft(-b));
|
|
557 }
|
|
558 }
|
|
559
|
|
560 }
|
|
561
|
|
562 @CoreMethod(names = "inspect", maxArgs = 0)
|
|
563 public abstract static class InpsectNode extends CoreMethodNode {
|
|
564
|
|
565 public InpsectNode(RubyContext context, SourceSection sourceSection) {
|
|
566 super(context, sourceSection);
|
|
567 }
|
|
568
|
|
569 public InpsectNode(InpsectNode prev) {
|
|
570 super(prev);
|
|
571 }
|
|
572
|
|
573 @Specialization
|
|
574 public RubyString inspect(BigInteger n) {
|
|
575 return getContext().makeString(n.toString());
|
|
576 }
|
|
577
|
|
578 }
|
|
579
|
|
580 @CoreMethod(names = "nonzero?", maxArgs = 0)
|
|
581 public abstract static class NonZeroNode extends CoreMethodNode {
|
|
582
|
|
583 public NonZeroNode(RubyContext context, SourceSection sourceSection) {
|
|
584 super(context, sourceSection);
|
|
585 }
|
|
586
|
|
587 public NonZeroNode(NonZeroNode prev) {
|
|
588 super(prev);
|
|
589 }
|
|
590
|
|
591 @Specialization
|
|
592 public Object nonZero(BigInteger value) {
|
|
593 if (value.compareTo(BigInteger.ZERO) == 0) {
|
|
594 return false;
|
|
595 } else {
|
|
596 return value;
|
|
597 }
|
|
598 }
|
|
599
|
|
600 }
|
|
601
|
|
602 @CoreMethod(names = "times", needsBlock = true, maxArgs = 0)
|
|
603 public abstract static class TimesNode extends YieldingCoreMethodNode {
|
|
604
|
|
605 public TimesNode(RubyContext context, SourceSection sourceSection) {
|
|
606 super(context, sourceSection);
|
|
607 }
|
|
608
|
|
609 public TimesNode(TimesNode prev) {
|
|
610 super(prev);
|
|
611 }
|
|
612
|
|
613 @Specialization
|
|
614 public BigInteger times(VirtualFrame frame, BigInteger n, RubyProc block) {
|
|
615 for (BigInteger i = BigInteger.ZERO; i.compareTo(n) < 0; i = i.add(BigInteger.ONE)) {
|
|
616 yield(frame, block, i);
|
|
617 }
|
|
618
|
|
619 return n;
|
|
620 }
|
|
621
|
|
622 }
|
|
623
|
|
624 @CoreMethod(names = "to_s", maxArgs = 0)
|
|
625 public abstract static class ToSNode extends CoreMethodNode {
|
|
626
|
|
627 public ToSNode(RubyContext context, SourceSection sourceSection) {
|
|
628 super(context, sourceSection);
|
|
629 }
|
|
630
|
|
631 public ToSNode(ToSNode prev) {
|
|
632 super(prev);
|
|
633 }
|
|
634
|
|
635 @Specialization
|
|
636 public RubyString toS(BigInteger value) {
|
|
637 return getContext().makeString(value.toString());
|
|
638 }
|
|
639
|
|
640 }
|
|
641
|
|
642 }
|