diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsComplex.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsComplex.java index 56de0ead0465957c4b675379c08bdefe7d3d360e..d62792b3b69f6136611edd494fd1b510a695db74 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsComplex.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsComplex.java @@ -29,12 +29,13 @@ import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.r.nodes.builtin.CastBuilder; import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; +import com.oracle.truffle.r.runtime.RDispatch; import com.oracle.truffle.r.runtime.builtins.RBuiltin; import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RNull; import com.oracle.truffle.r.runtime.data.model.RAbstractComplexVector; -@RBuiltin(name = "as.complex", kind = PRIMITIVE, parameterNames = {"x", "..."}, behavior = PURE) +@RBuiltin(name = "as.complex", kind = PRIMITIVE, dispatch = RDispatch.INTERNAL_GENERIC, parameterNames = {"x", "..."}, behavior = PURE) public abstract class AsComplex extends RBuiltinNode { private final ConditionProfile noAttributes = ConditionProfile.createBinaryProfile(); diff --git a/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/ParserGeneration.java b/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/ParserGeneration.java index da55693ade5c7ff705f8ef32907ecdb3b8528b16..4723391c1cf5ffb854e54e93e1f782cbb0120e17 100644 --- a/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/ParserGeneration.java +++ b/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/ParserGeneration.java @@ -86,6 +86,7 @@ public class ParserGeneration { "remove deprecated calls to Source functions", "remove restricion on fixed number of digits in UTF codes", "support ? for help", - "support for hex float literals" + "support for hex float literals", + "support for hex float literals without decimal point: 0x0p0", }; } diff --git a/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/R.g b/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/R.g index 67d55e42b902b7ddfda8426e2fb97a87511624ce..78c92fcb0f7257ea1525b48384da9a7573b3ba7e 100644 --- a/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/R.g +++ b/com.oracle.truffle.r.parser/src/com/oracle/truffle/r/parser/R.g @@ -575,13 +575,13 @@ INTEGER COMPLEX : ('0'..'9')+ '.' ('0'..'9')* EXPONENT? 'i' { setText(getText().substring(0, getText().length()-1)); } | '.'? ('0'..'9')+ EXPONENT? 'i' { setText(getText().substring(0, getText().length()-1)); } - | '0x' HEX_DIGIT+ ('.' HEX_DIGIT* HEX_EXPONENT)? 'i' { setText(getText().substring(0, getText().length()-1)); } + | '0x' HEX_DIGIT+ ('.'? HEX_DIGIT* HEX_EXPONENT)? 'i' { setText(getText().substring(0, getText().length()-1)); } ; DOUBLE : ('0'..'9')+ '.' ('0'..'9')* EXPONENT? | '.'? ('0'..'9')+ EXPONENT? - | '0x' HEX_DIGIT+ ('.' HEX_DIGIT* HEX_EXPONENT)? + | '0x' HEX_DIGIT+ ('.'? HEX_DIGIT* HEX_EXPONENT)? ; DD : '..' ('0'..'9')+ ; diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test index 56aeec68c5e413f79a0639c2016ec05c90038fcf..95e5030c9f694b7236f4659956ff11cd084181cf 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test @@ -113472,12 +113472,12 @@ $variables list(y, z) -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rbeta(10, 10, 10) [1] 0.4202441 0.5231868 0.3929161 0.7104015 0.5416782 0.3949132 0.5618393 [8] 0.5943116 0.5732049 0.4613867 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rbeta(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] NaN 0.00000000 1.00000000 0.82338531 0.17213601 NaN [7] 1.00000000 NaN 0.00000000 0.06525112 NaN 1.00000000 @@ -113486,7 +113486,7 @@ list(y, z) Warning message: In rbeta(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rbeta(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] 9.999998e-01 6.842102e-313 1.000000e+00 5.020914e-01 5.000000e-01 [6] 1.000000e+00 NaN 0.000000e+00 1.000000e+00 1.000000e+00 @@ -113497,7 +113497,7 @@ Warning message: In rbeta(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rbeta(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN 1.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0.0 NaN NaN [20] NaN NaN 0.0 NaN NaN NaN NaN NaN NaN 0.5 NaN @@ -113505,12 +113505,12 @@ Warning message: In rbeta(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rcauchy(10, 10, 10) [1] 21.025199 33.538306 -32.926262 7.033574 17.346469 6.694780 [7] 8.244206 -8.082431 -13.286244 11.965824 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rcauchy(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] NaN 0.0000000 0.3102520 4.1184475 -9.8778787 NaN [7] 5.0000000 -1.0296643 0.6611822 -0.7915660 NaN 3.0000000 @@ -113519,7 +113519,7 @@ In rbeta(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) : Warning message: In rcauchy(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rcauchy(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] 1.372945e-01 4.125212e-04 -1.053640e-78 6.212756e+03 1.370371e+72 [6] 6.530000e-02 NaN -2.158309e-02 8.833000e+03 7.900000e+71 @@ -113530,7 +113530,7 @@ Warning message: In rcauchy(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rcauchy(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN Inf NaN NaN NaN NaN NaN -Inf NaN NaN NaN NaN NaN [16] NaN NaN NaN NaN NaN NaN 0 NaN NaN NaN NaN NaN NaN NaN NaN @@ -113538,12 +113538,12 @@ Warning message: In rcauchy(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rchisq(10, 10, 10) [1] 11.63643 18.45545 21.64372 16.07794 20.36424 15.71556 20.77667 26.42402 [9] 20.58523 10.62996 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rchisq(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] NaN 0.000000e+00 1.461521e-04 1.839736e+00 6.956474e-01 [6] NaN 3.209835e+00 NaN 7.291872e+00 7.885483e+00 @@ -113552,7 +113552,7 @@ In rcauchy(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : Warning message: In rchisq(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rchisq(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] 2.046068e-13 0.000000e+00 0.000000e+00 1.771339e+04 1.580000e+72 [6] 8.055558e-18 NaN 0.000000e+00 8.829848e+03 7.900000e+71 @@ -113563,7 +113563,7 @@ Warning message: In rchisq(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rchisq(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN [20] NaN NaN 0 NaN NaN NaN NaN NaN NaN NaN NaN @@ -113571,12 +113571,12 @@ Warning message: In rchisq(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rf(10, 10, 10) [1] 0.4211249 1.4022872 0.3264808 1.0686054 1.3072335 0.8433459 1.5694522 [8] 1.0962100 1.0552082 3.6708927 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rf(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] NaN NaN 5.990604e-02 2.030321e+00 4.383017e-01 [6] NaN NaN NaN NaN 4.387668e-04 @@ -113585,7 +113585,7 @@ In rchisq(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : Warning message: In rf(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rf(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] 5.907040e-11 NaN NaN 1.024705e+00 1.000000e+00 [6] NaN NaN 0.000000e+00 Inf Inf @@ -113596,7 +113596,7 @@ Warning message: In rf(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rf(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN [20] NaN NaN NaN NaN NaN NaN NaN NaN NaN 1 NaN @@ -113604,12 +113604,12 @@ Warning message: In rf(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rgamma(10, 10, 10) [1] 0.7667251 1.4040808 1.3826660 1.0820993 0.5346417 1.1061754 1.1911950 [8] 1.1357558 0.8582045 0.7196892 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rgamma(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] NaN 0.00000000 0.01881730 1.92594160 0.45110798 NaN [7] Inf NaN 0.00000000 0.05989429 NaN Inf @@ -113618,7 +113618,7 @@ In rf(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) : Warning message: In rgamma(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rgamma(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] 3.336908e-08 0.000000e+00 0.000000e+00 1.003452e+00 1.000000e+00 [6] Inf NaN 0.000000e+00 7.180454e+07 2.468750e+150 @@ -113629,7 +113629,7 @@ Warning message: In rgamma(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rgamma(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN Inf 0 NaN NaN NaN NaN NaN NaN 0 NaN NaN NaN NaN 0 NaN NaN [20] NaN NaN 0 NaN 0 NaN NaN NaN NaN 0 0 @@ -113637,19 +113637,19 @@ Warning message: In rgamma(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rlogis(10, 10, 10) [1] -0.1753073 4.7688401 12.9350241 32.9194576 -3.7581524 31.7945887 [7] 38.3762121 16.6685147 15.2841793 -17.2029660 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rlogis(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] 0.01753073 0.00000000 0.14768840 2.26415217 9.87583728 5.37581524 [7] 5.00000000 -0.78205411 2.55385909 2.20055441 1.47158207 3.00000000 [13] 3.72797034 3.78557353 -5.61955679 -0.78623735 0.20000000 1.95278340 [19] 4.08667440 3.97239071 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rlogis(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] -1.144757e-03 5.865673e-05 4.139208e-79 2.907776e+04 -2.968940e+71 [6] 6.530000e-02 -2.179336e+00 1.852967e-01 8.833000e+03 7.900000e+71 @@ -113657,7 +113657,7 @@ In rgamma(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : [16] 6.524192e-02 1.230000e-04 -8.129095e+01 7.368165e+71 7.900000e+71 [21] -4.743217e+00 -3.183475e-02 1.538533e-04 8.833000e+03 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rlogis(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN Inf NaN NaN NaN NaN NaN -Inf NaN NaN NaN NaN NaN [16] NaN NaN NaN NaN NaN NaN 0 NaN NaN NaN NaN NaN NaN NaN NaN @@ -113665,12 +113665,12 @@ Warning message: In rlogis(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rnorm(10, 10, 10) [1] 3.735462 11.836433 1.643714 25.952808 13.295078 1.795316 14.874291 [8] 17.383247 15.757814 6.946116 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rnorm(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] NaN 0.0000000 0.1373546 2.1652790 0.4931142 NaN [7] 5.0000000 -0.8404719 0.2965570 -2.2614052 NaN 3.0000000 @@ -113679,7 +113679,7 @@ In rlogis(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : Warning message: In rnorm(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rnorm(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] 2.439257e-02 1.455881e-04 5.259884e-80 2.292412e+04 1.050311e+72 [6] 6.530000e-02 NaN -5.357659e-02 8.833000e+03 7.900000e+71 @@ -113690,7 +113690,7 @@ Warning message: In rnorm(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rnorm(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN Inf NaN NaN NaN NaN NaN -Inf NaN NaN NaN NaN NaN [16] NaN NaN NaN NaN NaN NaN 0 NaN NaN NaN NaN NaN NaN NaN NaN @@ -113698,11 +113698,11 @@ Warning message: In rnorm(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); runif(10, 10, 10) [1] 10 10 10 10 10 10 10 10 10 10 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); runif(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] -1.0000000 0.0000000 NaN NaN 3.0000000 NaN [7] NaN -0.7079405 0.3349115 1.8039894 NaN NaN @@ -113711,7 +113711,7 @@ In rnorm(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) : Warning message: In runif(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); runif(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] 6.530000e-02 1.230000e-04 3.200000e-79 8.833000e+03 7.900000e+71 [6] NaN NaN 1.733772e-02 NaN NaN @@ -113722,7 +113722,7 @@ Warning message: In runif(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); runif(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN [20] NaN NaN 0 NaN NaN NaN NaN NaN NaN NaN NaN @@ -113730,12 +113730,12 @@ Warning message: In runif(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rweibull(10, 10, 10) [1] 10.286269 9.988469 9.431816 7.913244 10.481920 7.998338 7.507960 [8] 9.156558 9.259757 11.078171 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rweibull(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] NaN 0.000000e+00 4.101041e-01 8.948229e-01 2.468533e+00 [6] NaN 0.000000e+00 NaN NaN 2.482268e-05 @@ -113744,7 +113744,7 @@ In runif(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) : Warning message: In rweibull(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rweibull(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) [1] 4.921274e+00 2.245712e-45 0.000000e+00 8.830660e+03 7.900000e+71 [6] 0.000000e+00 NaN 0.000000e+00 1.229601e-04 3.200000e-79 @@ -113755,7 +113755,7 @@ Warning message: In rweibull(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rweibull(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) [1] NaN NaN NaN 0 NaN NaN NaN NaN NaN 0 NaN NaN NaN NaN NaN 0 NaN NaN NaN [20] NaN NaN 0 NaN NaN NaN NaN NaN 0 NaN NaN @@ -113763,22 +113763,22 @@ Warning message: In rweibull(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rwilcox(10, 10, 10) [1] 48 56 42 49 53 61 46 67 30 47 -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rwilcox(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) [1] NA 0 0 0 7 NA 0 NA 0 0 NA 0 0 1 NA NA 0 0 3 11 Warning message: In rwilcox(20, c(-1, 0, 0.2, 2:5), c(-1, 0, 0.1, 0.9, 3)) : NAs produced -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rwilcox(24, c(0.0653, 0.000123, 32e-80, 8833, 79e70), c(0.0653, 0.000123, 32e-80, 8833, 79e70, 0, -1)) Error in rwilcox(24, c(0.0653, 0.000123, 3.2e-79, 8833, 7.9e+71), c(0.0653, : 'Calloc' could not allocate memory (18446744071562067968 of 4 bytes) -##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWarningContext# +##com.oracle.truffle.r.test.library.stats.TestRandGenerationFunctions.testFunctions2#Output.IgnoreWhitespace# #set.seed(1); rwilcox(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, -1/0)) Error in rwilcox(30, c(NA, 0, NaN, 1/0, -1/0), c(NaN, NaN, NA, 0, 1/0, : 'Calloc' could not allocate memory (18446744071562067968 of 4 bytes) @@ -114917,6 +114917,10 @@ see '?methods' for accessing help and source code "","double","bool","raw" "1",1231231234.5,TRUE,2a +##com.oracle.truffle.r.test.parser.TestParser.testDoubleLiterals# +#0x0p0 +[1] 0 + ##com.oracle.truffle.r.test.parser.TestParser.testDoubleLiterals# #0x1.1p2 [1] 4.25 @@ -114925,6 +114929,10 @@ see '?methods' for accessing help and source code #0x1.aP2 [1] 6.5 +##com.oracle.truffle.r.test.parser.TestParser.testDoubleLiterals# +#0x1p2 +[1] 4 + ##com.oracle.truffle.r.test.parser.TestParser.testDoubleLiterals# #0xa.bp1i [1] 0+21.375i diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/parser/TestParser.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/parser/TestParser.java index 70c0576471b398ce18e964abbe6d7cdc45759257..eec0fb6933b2b887143e19524bb5c7f5fcf6ab09 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/parser/TestParser.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/parser/TestParser.java @@ -54,6 +54,8 @@ public class TestParser extends TestBase { @Test public void testDoubleLiterals() { assertEval("0x1.1p2"); + assertEval("0x1p2"); + assertEval("0x0p0"); assertEval("0x1.aP2"); assertEval("0xa.p2"); assertEval("0xa.bp1i");