diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java index d9a6c913e28db21fbd8dc84706a5e46f7ab6920d..a921d98f18b85fe3ff40d16aa6b8bcaf3e726c4b 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java @@ -170,16 +170,6 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS this.explicitArgs = null; this.varArgIndexes = getVarArgIndexes(arguments); this.lookupVarArgs = varArgIndexes.length == 0 ? null : ReadVariableNode.createSilent(ArgumentsSignature.VARARG_NAME, RType.Any); - - for (String name : signature) { - if (name != null && name.isEmpty()) { - /* - * In GnuR this is evidently output by the parser, so very early, and never with a - * caller in the message. - */ - throw RError.error(RError.NO_CALLER, RError.Message.ZERO_LENGTH_VARIABLE); - } - } this.signature = signature; } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastSymbolNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastSymbolNode.java index 4aac86672059849ec14bb72e51fcb83f65192eaa..2b45b6639ae5045f8d4941d354b0fc0bf958e45a 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastSymbolNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastSymbolNode.java @@ -22,6 +22,7 @@ */ package com.oracle.truffle.r.nodes.unary; +import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.r.runtime.RError; @@ -88,7 +89,10 @@ public abstract class CastSymbolNode extends CastBaseNode { @Specialization @TruffleBoundary protected RSymbol doString(String value) { - // TODO: see if this is going to hit us performance-wise + if (value.isEmpty()) { + CompilerDirectives.transferToInterpreter(); + throw error(RError.Message.ZERO_LENGTH_VARIABLE); + } return RDataFactory.createSymbolInterned(value); } 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 4b3743e6598b9a5e6f38c20f7d4206c28af54290..76e8351cb9a82020724fb76869eac71177c84b17 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 @@ -88,6 +88,7 @@ public class ParserGeneration { "support ? for help", "support for hex float literals", "support for hex float literals without decimal point: 0x0p0", - "different warning for hex and dec integer literals" + "different warning for hex and dec integer literals", + "raise ZERO_LENGTH_VARIABLE errors in parser" }; } 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 e30c5f77e93f06e835f9ed79e84535940fbac7eb..c1e9f36e56e3b8eb98586c9157f5268bda0ab90b 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 @@ -48,6 +48,8 @@ import com.oracle.truffle.r.runtime.nodes.RCodeBuilder.Argument; @lexer::header { //@formatter:off package com.oracle.truffle.r.parser; + +import com.oracle.truffle.r.runtime.RError; } @rulecatch { @@ -81,9 +83,19 @@ package com.oracle.truffle.r.parser; * Helper function to create a function lookup for the symbol in a given token. */ private T operator(Token op) { - return builder.lookup(src(op), op.getText(), true); + return builder.lookup(src(op), argName(op.getText()), true); } + /** + * Helper to check for empty lookups. + */ + private String argName(String name) { + if (name.length() == 0) { + throw RError.error(RError.NO_CALLER, RError.Message.ZERO_LENGTH_VARIABLE); + } + return name; + } + /** * Create a {@link SourceSection} from a single token. */ @@ -487,8 +499,8 @@ args [T firstArg] returns [List<Argument<T>> v] arg_expr [List<Argument<T>> l] @init { Token start = input.LT(1); } : e=expr { $l.add(RCodeBuilder.argument(src(start, last()), (String) null, $e.v)); } - | name=(ID | VARIADIC | NULL | STRING) n_ ASSIGN n_ e=expr { $l.add(RCodeBuilder.argument(src($name, last()), $name.text, $e.v)); } - | name=(ID | VARIADIC | NULL | STRING) n_ a=ASSIGN { $l.add(RCodeBuilder.argument(src($name, $a), $name.text, null)); } + | name=(ID | VARIADIC | NULL | STRING) n_ ASSIGN n_ e=expr { $l.add(RCodeBuilder.argument(src($name, last()), argName($name.text), $e.v)); } + | name=(ID | VARIADIC | NULL | STRING) n_ a=ASSIGN { $l.add(RCodeBuilder.argument(src($name, $a), argName($name.text), null)); } ; /// @@ -606,7 +618,12 @@ fragment BACKTICK_NAME | i = ~( '\\' | '`' ) { buf.appendCodePoint(i); } )* '`' - { setText(buf.toString()); } + { + if (buf.length() == 0) { + throw RError.error(RError.NO_CALLER, RError.Message.ZERO_LENGTH_VARIABLE); + } + setText(buf.toString()); + } ) ; 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 8721518a966e0a74cb241e2eadc708d60bc10e50..d2b8d348afca9b406a771c45203a6385f5155181 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 @@ -386,7 +386,7 @@ Slot "j": #{ setClass("foo"); setClass("bar", representation(j = "numeric"), contains = "foo"); is.null(getClass("foo")@prototype) } [1] FALSE -##com.oracle.truffle.r.test.S4.TestS4.testClassCreation#Ignored.OutputFormatting# +##com.oracle.truffle.r.test.S4.TestS4.testClassCreation# #{ setClass("foo", representation(j="numeric")); getClass("foo") } Class "foo" [in ".GlobalEnv"] @@ -1287,7 +1287,7 @@ $vt [1,] 0 -##com.oracle.truffle.r.test.builtins.TestBuiltin_La.testLa9#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_La.testLa9# #argv <- list(structure(c(-9.64365076099295, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, 0.103695169473043, -29634.0055320061, -5658.08855789941, 0.0595010632288954, 0.0648032071760975, 0.106336668095848, -0.0279843118999398, 0.0762911857283688, 0.188519899277481, 0.0807096390177039, 0.102801905464379, 0.158474416910002, -0.0969121832135675, -0.0447744343994132, 0.0356414154664858, 0.0276881995456826, -5.08106330417909, 3.14280306547868, 3.64768208463163, 0.0962151262827947, -0.216651778533863, -0.0914289830351174, 0.0855052819309283, -0.0191216590449975, 0.0813861110263642, 0.0607902565035442, 0.00888870310603775, -0.027169916923919, -0.0757761335977742, 0.123401654252917, -0.143330536432624, -0.207390338946085, -0.18719988871654, -0.127596387499216, 1.38045811630541, 0.0118370110620473, 0.00504893180870276, 0.0281684584122627, 0.0338400772620966, 0.0283917504929648, 0.0295082108964754, 0.0323216911133222, 0.00156557534974961, 0.00420042190203468, 0.0261141712698031, 0.00786241202554953, -3.21455025366432, -2.66432733346907, -2.18217405946767, -1.0459324747522, 2.77707906967759, -0.000588115022584812, -0.0784367740030637, -0.0437014732535189, -0.0770692424774911, 0.28985899050302, 0.307089887725235, -0.0219216068215179, -0.00578473481976082, -0.0910180640383319, 0.0166427821996303, -0.725866186311298, -0.943724610301472, -0.197997366006898, -0.255325765345392, -1.99736582726463, 1.22009740929232, -0.000660179745382102, 0.118090770461339, 0.00401505451472504, -0.265276591063721, -0.206368639386371, -0.0413572976755921, 0.0138104665936721, -0.0436723349383677, 0.0904843084594291, -0.103695169473043, 0.0314422837299137, -0.171533212490836, -0.0271695331685966, -0.234884785308008, -0.455412006973628, -0.833981960018826, -0.0497205266764892, -0.00169048456815939, 0.0359873442560765, 0.0111849454624309, 0.0174129325629219, -0.00581471075176227, 0.0183876477886015, -0.0380971980704758, -1.14064686420347, -1.21031412747477, -0.546078284372325, -0.385964209884133, -0.535335872363138, 0.617909299639904, 0.034437791264286, -2.66782912116871, -0.0707120154460491, 0.170259689757997, -0.200116024334743, -0.0120487035676503, -0.00787104751465206, -0.0743232096613527, -0.00206481367828156, -2.28129372840694, -1.27183039972242, -0.162921372163874, 0.194143545128708, 0.405329624202872, -0.0239884453210967, 0.161826508366356, 1.47283157923894, -3.57122150532158, 0.0184573285734211, 0.0768346205272587, -0.00300367200170235, -0.047539037475449, -0.0955077077363865, 0.170580587807138, -2.17759855893389, 2.82091161681306, -0.529126651121425, 0.00648102843720064, -0.227590137804697, 0.429332016819553, 0.315382802791974, -0.0921680424483324, 0.358484158960907, 2.74734594573339, -0.00180797874108619, 0.211048746835586, 0.146553774483952, 0.0892496085418831, 0.02104367339158, -1.4517323726226, 0.428703993666521, -0.198393471445493, -0.178300389025286, -0.0518091667043893, 0.133208332446864, -1.01393441911662, 0.520772381447608, 0.936102434059857, -1.6420319436063, 2.59716822825227, 0.194828402482676, 0.15057424104202, -0.232155536267878, -0.0298159890277092, -0.933256525257383, -1.20515451427884, 0.0125087156504907, 0.421920000319943, 0.452875082015975, -0.655679104390575, 0.284781968418535, 0.643096539054797, 1.38165893036928, 0.447700892848835, -0.482856979100538, 1.73960015308741, 0.115853953901054, 0.107343556163412, -0.0385322695831968, -25.7267715462619, -8.40853040573162, -1.45105839286435, -1.58984152452525, -1.59606771970776, 2.79428919380473, 0.596892611732863, -1.03839368638655, -0.0376487500979583, -0.507302835476536, 0.184174590388395, -0.70905481454677, -3.32884312972433, 0.134236291836065, -0.0993249017707237, -6.94757635469386, 1.58613921242054, 0.195741168102286, 0.638223445194413, 1.07571321411184, 0.659104584950073, 0.199707908602043, -0.565980943574209, -0.967985377031296, -0.112927393875596, -0.934672543429794, 0.198159847509218, 0.275086401661377, 3.44668029704689, -0.05066048099299, -1.65912271156868, -1.17593571026872, -0.20132598039105, -0.42732880950559, -1.20727437557593, 0.102943259109259, -0.697974199306205, 0.103630431164098, -0.0620963660266192, -0.16978912837867, 0.739571733406047, -0.872308493604205, -0.757980967070979, -2.00985526447536, -1.92891236077264), .Dim = c(15L, 15L), .Dimnames = list(c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15'), c('(Intercept)', 'Weight', 'Cylinders4', 'Cylinders5', 'Cylinders6', 'Cylinders8', 'Cylindersrotary', 'TypeLarge', 'TypeMidsize', 'TypeSmall', 'TypeSporty', 'TypeVan', 'EngineSize', 'DriveTrainFront', 'DriveTrainRear'))), 15L); .Internal(La_chol2inv(argv[[1]], argv[[2]])) [,1] [,2] [,3] [,4] [,5] [1,] 2.4965590071 -8.201566e-04 0.0523016012 0.4022192142 0.3409468314 @@ -19342,7 +19342,7 @@ attr(,"hessian") [1,] 1 -##com.oracle.truffle.r.test.builtins.TestBuiltin_deriv.testDeriveFunctions1#Ignored.Unimplemented# +##com.oracle.truffle.r.test.builtins.TestBuiltin_deriv.testDeriveFunctions1# #df <- deriv(~ gamma(x), c("x"), hessian=FALSE); x<-0; eval(df) [1] NaN attr(,"gradient") @@ -19366,7 +19366,7 @@ attr(,"gradient") x [1,] Inf -##com.oracle.truffle.r.test.builtins.TestBuiltin_deriv.testDeriveFunctions1#Ignored.MissingWarning# +##com.oracle.truffle.r.test.builtins.TestBuiltin_deriv.testDeriveFunctions1# #df <- deriv(~ log(x), c("x"), hessian=TRUE); x<--1; eval(df) [1] NaN attr(,"gradient") @@ -23969,11 +23969,11 @@ logical(0) #argv <- list(character(0)); .Internal(file.exists(argv[[1]])) logical(0) -##com.oracle.truffle.r.test.builtins.TestBuiltin_fileinfo.testfileinfo1#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_fileinfo.testfileinfo1# #argv <- list('/home/lzhao/hg/r-instrumented/library/codetools/data'); .Internal(file.info(argv[[1]])) Error: 1 argument passed to .Internal(file.info) which requires 2 -##com.oracle.truffle.r.test.builtins.TestBuiltin_fileinfo.testfileinfo2#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_fileinfo.testfileinfo2# #argv <- list(character(0)); .Internal(file.info(argv[[1]])) Error: 1 argument passed to .Internal(file.info) which requires 2 @@ -24168,7 +24168,7 @@ NULL #argv <- list(structure(list(c0 = structure(integer(0), .Label = character(0), class = 'factor')), .Names = 'c0', row.names = character(0), class = 'data.frame')); .Internal(formals(argv[[1]])) NULL -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat1#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat1#Output.IgnoreErrorMessage# #argv <- list(structure(c(0, 72.7, 56.4, 72.7, 0, 63.3, 56.4, 63.3, 0), .Dim = c(3L, 3L), .Dimnames = list(c('Girth', 'Height', 'Volume'), c('Girth', 'Height', 'Volume'))), FALSE, 7L, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]], , argv[[9]])) Error in .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], : argument 10 is empty @@ -24183,7 +24183,7 @@ Error in .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], : 1 2 <NA> "1" "2" "1" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat12#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat12# #argv <- list(c('Min.', '1st Qu.', 'Median', 'Mean', '3rd Qu.', 'Max.'), FALSE, NULL, 0L, NULL, 0L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "Min. " "1st Qu." "Median " "Mean " "3rd Qu." "Max. " @@ -24191,12 +24191,12 @@ Error in .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], : #argv <- list(c(1L, 2L, 3L, 4L, 5L, -1L, -2L), FALSE, NULL, 0L, NULL, 3L, FALSE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] " 1" " 2" " 3" " 4" " 5" "-1" "-2" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat14#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat14# #argv <- list(structure(c(NA, 1, 1, 1), .Names = c('<none>', '- x4', '- x2', '- x1')), FALSE, 5L, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) <none> - x4 - x2 - x1 "NA" " 1" " 1" " 1" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat15#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat15# #argv <- list(2.22044604925031e-16, FALSE, 1, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "2e-16" @@ -24225,11 +24225,11 @@ Error in argv[[9]] : subscript out of bounds #argv <- list(c('abc', NA, 'def'), FALSE, NULL, 0L, NULL, 3L, FALSE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "abc" NA "def" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat23#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat23# #argv <- list(c(NA, 2L, 4L, 7L), FALSE, NULL, 0L, NULL, 3L, FALSE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "NA" " 2" " 4" " 7" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat24#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat24# #argv <- list(c(1.1+0i, NA, 3+0i), FALSE, NULL, 0L, NULL, 3L, FALSE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "1.1+0i" " NA" "3.0+0i" @@ -24241,7 +24241,7 @@ Error in argv[[9]] : subscript out of bounds #argv <- list(c(172, 88, 88, 55, 92, 92, 72, 72, 63, 63), TRUE, NULL, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "172" "88" "88" "55" "92" "92" "72" "72" "63" "63" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat27#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat27# #argv <- list(structure(c(142L, 104L, 71L, 250L), .Dim = 4L, .Dimnames = structure(list(c('(1) Approve STRONGLY', '(2) Approve SOMEWHAT', '(3) Disapprove SOMEWHAT', '(4) Disapprove STRONGLY')), .Names = '')), FALSE, 7L, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) (1) Approve STRONGLY (2) Approve SOMEWHAT (3) Disapprove SOMEWHAT @@ -24249,11 +24249,11 @@ Error in argv[[9]] : subscript out of bounds (4) Disapprove STRONGLY "250" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat28#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat28# #argv <- list(structure(c('***', '*', ' ', ' ', ' '), legend = '0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1', class = 'noquote'), FALSE, NULL, 0L, NULL, 0L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "***" "* " " " " " " " -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat29#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat29# #argv <- list(structure(c(0, 5, 118, 57, 0, 1, 4, 140, 0, 11, 154, 14, 0, 13, 13, 80, 35, 13, 387, 75, 17, 14, 89, 76, 0, 0, 670, 192, 0, 0, 3, 20), .Dim = c(1L, 32L), row.vars = structure(list(), .Names = character(0)), col.vars = structure(list(Class = c('1st', '2nd', '3rd', 'Crew'), Sex = c('Male', 'Female'), Age = c('Child', 'Adult'), Survived = c('No', 'Yes')), .Names = c('Class', 'Sex', 'Age', 'Survived'))), FALSE, 7L, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] " 0" " 5" "118" " 57" " 0" " 1" " 4" "140" " 0" " 11" "154" " 14" @@ -24262,11 +24262,11 @@ Error in argv[[9]] : subscript out of bounds [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] " 0" " 0" "670" "192" " 0" " 0" " 3" " 20" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat3#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat3# #argv <- list(c('Inf', '-Inf', 'NaN', 'NA'), FALSE, NULL, 0L, 4, 1L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] " Inf" "-Inf" " NaN" " NA" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat30#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat30# #argv <- list(c('', '', '\'Adult\'', '\'No\'', '', '387'), FALSE, NULL, 0L, NULL, 1L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] " " " " "'Adult'" " 'No'" " " " 387" @@ -24274,7 +24274,7 @@ Error in argv[[9]] : subscript out of bounds #argv <- list(2.2250738585072e-308, TRUE, NULL, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "2.225074e-308" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat32#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat32# #argv <- list(c(-0.318309886183791+0i, 0-0.564189583547756i, 1+0i, 0+1.77245385090552i, -3.14159265358979+0i), TRUE, 2, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "-0.32+0.00i" "0.00-0.56i" "1.00+0.00i" "0.00+1.77i" "-3.14+0.00i" @@ -24312,7 +24312,7 @@ Error in argv[[9]] : subscript out of bounds #argv <- list(structure(integer(0), .Label = character(0), class = 'factor'), TRUE, NULL, 0L, NULL, 3L, FALSE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) character(0) -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat37#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat37# #argv <- list(structure(c(213198964, 652424.52183908), .Names = c('null.deviance', 'deviance')), FALSE, 5L, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) null.deviance deviance "213198964" " 652425" @@ -24326,7 +24326,7 @@ null.deviance deviance #argv <- list(FALSE, FALSE, NULL, 0L, NULL, 3L, FALSE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "FALSE" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat4#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat4# #argv <- list(structure(c('axx', 'b', 'c', 'd', 'e', 'f', 'g', 'h'), .Dim = c(2L, 4L)), FALSE, NULL, 0L, NULL, 1L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [,1] [,2] [,3] [,4] [1,] "axx" " c" " e" " g" @@ -24347,11 +24347,11 @@ null.deviance deviance [61] "3084" "2605" "2573" "2143" "1693" "1504" "1461" "1354" "1333" "1492" [71] "1781" "1915" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat42#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat42# #argv <- list(c(2.5, 97.5), TRUE, 3, 0L, NULL, 3L, TRUE, FALSE, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "2.5" "97.5" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat43#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat43# #argv <- list(structure(c(9.4, 10.2, 9.2, 4.4, 3.5, 2.7), .Dim = c(3L, 2L), .Dimnames = list(NULL, c('Estimate', 'Std.Err'))), FALSE, 2, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) Estimate Std.Err [1,] " 9.4" " 4.4" @@ -24366,7 +24366,7 @@ null.deviance deviance #argv <- list(1.2e+07, FALSE, NULL, 9L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "1.2e+07" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat47#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat47# #argv <- list(-0.01234+3.14159265358979i, FALSE, NULL, 14L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "-0.01234000000000+3.14159265358979i" @@ -24374,7 +24374,7 @@ null.deviance deviance #argv <- list(c(TRUE, FALSE, TRUE, FALSE, FALSE, FALSE), FALSE, NULL, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] " TRUE" "FALSE" " TRUE" "FALSE" "FALSE" "FALSE" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat49#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat49# #argv <- list(3.141, FALSE, NULL, 13L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "3.1410000000000" @@ -24407,7 +24407,7 @@ null.deviance deviance #argv <- list(1e-11, FALSE, NULL, 0L, NULL, 3L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "1e-11" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat56#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat56# #argv <- structure(list(x = 0.04, digits = 3, nsmall = 3), .Names = c('x', 'digits', 'nsmall'));do.call('format', argv) [1] "0.040" @@ -24420,7 +24420,7 @@ null.deviance deviance <none> - x4 - x2 - x1 " 47.97" " 57.90" " 74.76" "868.88" -##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat7#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_format.testformat7# #argv <- list(c('a', 'NA', NA, 'b'), FALSE, NULL, 0L, NULL, 0L, TRUE, NA, "."); .Internal(format(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) [1] "a " "NA" "NA" "b " @@ -24448,11 +24448,11 @@ character(0) #argv <- list(c(0, 25, 50, 75, 100), 'double', 1, 6L, 'fg', '', c(14L, 13L, 13L, 13L, 13L)); .Internal(formatC(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]])) [1] "0" "25" "50" "75" "100" -##com.oracle.truffle.r.test.builtins.TestBuiltin_formatC.testformatC12#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_formatC.testformatC12# #argv <- list(5L, 'integer', 2, 2L, 'd', '', 10L); .Internal(formatC(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]])) [1] " 5" -##com.oracle.truffle.r.test.builtins.TestBuiltin_formatC.testformatC13#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_formatC.testformatC13# #argv <- list(c(3.14159265358979e-05, 0.000314159265358979, 0.00314159265358979, 0.0314159265358979, 0.314159265358979, 3.14159265358979, 31.4159265358979, 314.159265358979, 3141.59265358979, 31415.9265358979), 'double', 5, 4, 'fg', '', c(15, 14, 13, 12, 11, 10, 9, 9, 9, 9)); .Internal(formatC(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]])) [1] "0.00003142" "0.0003142" "0.003142" "0.03142" "0.3142" [6] "3.142" "31.42" "314.2" " 3142" "31416" @@ -24480,7 +24480,7 @@ character(0) #argv <- list(c(-3, -2, -1, 0, 1, 2, 3), 'double', 1L, 4L, 'g', '', c(12L, 12L, 12L, 12L, 12L, 12L, 12L)); .Internal(formatC(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]])) [1] "-3" "-2" "-1" "0" "1" "2" "3" -##com.oracle.truffle.r.test.builtins.TestBuiltin_formatC.testformatC6#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_formatC.testformatC6# #argv <- list(3L, 'integer', 3, 2L, 'd', '0', 10L); .Internal(formatC(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]])) [1] "003" @@ -24488,7 +24488,7 @@ character(0) #argv <- list(c(0, 25, 50, 75, 100), 'double', 1, 7L, 'fg', '', c(16L, 15L, 15L, 15L, 15L)); .Internal(formatC(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]])) [1] "0" "25" "50" "75" "100" -##com.oracle.truffle.r.test.builtins.TestBuiltin_formatC.testformatC8#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_formatC.testformatC8# #argv <- list(structure(48.4333681840033, .Names = 'value'), 'double', 5L, 4L, 'g', '', 12L); .Internal(formatC(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]])) [1] "48.43" @@ -24605,7 +24605,7 @@ character(0) #argv <- list(712L, NULL, 0L); .Internal(format.info(argv[[1]], argv[[2]], argv[[3]])) [1] 3 -##com.oracle.truffle.r.test.builtins.TestBuiltin_formatpval.testformatpval1#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_formatpval.testformatpval1# #argv <- structure(list(pv = 0.200965994008331, digits = 3), .Names = c('pv', 'digits'));do.call('format.pval', argv) [1] "0.201" @@ -24613,14 +24613,14 @@ character(0) #argv <- list(1);g(argv[[1]]); Error: could not find function "g" -##com.oracle.truffle.r.test.builtins.TestBuiltin_gamma.testgamma1#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_gamma.testgamma1# #argv <- list(c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1));gamma(argv[[1]]); [1] NaN 9.513508 4.590844 2.991569 2.218160 1.772454 1.489192 1.298055 [9] 1.164230 1.068629 1.000000 Warning message: In gamma(argv[[1]]) : NaNs produced -##com.oracle.truffle.r.test.builtins.TestBuiltin_gamma.testgamma2#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_gamma.testgamma2# #argv <- list(FALSE);gamma(argv[[1]]); [1] NaN Warning message: @@ -24630,11 +24630,11 @@ In gamma(argv[[1]]) : NaNs produced #argv <- list(structure(numeric(0), .Dim = c(0L, 0L)));gamma(argv[[1]]); <0 x 0 matrix> -##com.oracle.truffle.r.test.builtins.TestBuiltin_gamma.testgamma5#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_gamma.testgamma5# #argv <- list(101);gamma(argv[[1]]); [1] 9.332622e+157 -##com.oracle.truffle.r.test.builtins.TestBuiltin_gamma.testgamma6#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_gamma.testgamma6# #argv <- list(c(-3.000001, -3, -3, -2.999999, -2.965, -2.93, -2.895, -2.86, -2.825, -2.79, -2.755, -2.72, -2.685, -2.65, -2.615, -2.58, -2.545, -2.51, -2.475, -2.44, -2.405, -2.37, -2.335, -2.3, -2.265, -2.23, -2.195, -2.16, -2.125, -2.09, -2.055, -2.02, -2.000001, -2, -1.999999, -1.985, -1.95, -1.915, -1.88, -1.845, -1.81, -1.775, -1.74, -1.705, -1.67, -1.635, -1.6, -1.565, -1.53, -1.495, -1.46, -1.425, -1.39, -1.355, -1.32, -1.285, -1.25, -1.215, -1.18, -1.145, -1.11, -1.075, -1.04, -1.005, -1.000001, -1, -0.999999, -0.97, -0.935, -0.9, -0.865, -0.83, -0.795, -0.76, -0.725, -0.69, -0.655, -0.62, -0.585, -0.55, -0.515, -0.48, -0.445, -0.41, -0.375, -0.34, -0.305, -0.27, -0.235, -0.2, -0.165, -0.13, -0.0949999999999998, -0.0599999999999996, -0.0249999999999999, -1e-06, 0, 1e-06, 0.0100000000000002, 0.0450000000000004, 0.0800000000000001, 0.115, 0.15, 0.185, 0.22, 0.255, 0.29, 0.325, 0.36, 0.395, 0.43, 0.465, 0.5, 0.535, 0.57, 0.605, 0.640000000000001, 0.675, 0.71, 0.745000000000001, 0.78, 0.815, 0.850000000000001, 0.885, 0.92, 0.955000000000001, 0.99, 1.025, 1.06, 1.095, 1.13, 1.165, 1.2, 1.235, 1.27, 1.305, 1.34, 1.375, 1.41, 1.445, 1.48, 1.515, 1.55, 1.585, 1.62, 1.655, 1.69, 1.725, 1.76, 1.795, 1.83, 1.865, 1.9, 1.935, 1.97, 2.005, 2.04, 2.075, 2.11, 2.145, 2.18, 2.215, 2.25, 2.285, 2.32, 2.355, 2.39, 2.425, 2.46, 2.495, 2.53, 2.565, 2.6, 2.635, 2.67, 2.705, 2.74, 2.775, 2.81, 2.845, 2.88, 2.915, 2.95, 2.985, 3.02, 3.055, 3.09, 3.125, 3.16, 3.195, 3.23, 3.265, 3.3, 3.335, 3.37, 3.405, 3.44, 3.475, 3.51, 3.545, 3.58, 3.615, 3.65, 3.685, 3.72, 3.755, 3.79, 3.825, 3.86, 3.895, 3.93, 3.965, 4));gamma(argv[[1]]); [1] 1.666665e+05 NaN NaN -1.666669e+05 -4.985099e+00 [6] -2.619025e+00 -1.841442e+00 -1.462054e+00 -1.242971e+00 -1.105073e+00 @@ -32988,7 +32988,7 @@ Error in eval(expr, envir, enclos) : object 'weight' not found #require(stats);lm(formula = weight ~ group, method = 'model.frame') Error in eval(expr, envir, enclos) : object 'weight' not found -##com.oracle.truffle.r.test.builtins.TestBuiltin_lm.testlm334#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_lm.testlm334# #require(stats);lm(data = LifeCycleSavings, formula = sr ~ pop15 + pop75 + dpi + ddpi) Call: @@ -32999,7 +32999,7 @@ Coefficients: 28.5660865 -0.4611931 -1.6914977 -0.0003369 0.4096949 -##com.oracle.truffle.r.test.builtins.TestBuiltin_lm.testlm445#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_lm.testlm445# #require(stats);lm(data = attitude, formula = rating ~ .) Call: @@ -33012,7 +33012,7 @@ Coefficients: -0.21706 -##com.oracle.truffle.r.test.builtins.TestBuiltin_lm.testlm875#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_lm.testlm875# #require(stats); lm(data = mtcars, formula = 100/mpg ~ disp + hp + wt + am) Call: @@ -33023,7 +33023,7 @@ Coefficients: 0.740648 0.002703 0.005275 1.001303 0.155815 -##com.oracle.truffle.r.test.builtins.TestBuiltin_lm.testlm876#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_lm.testlm876# #require(stats); lm(data = npk, formula = yield ~ block + N * P * K, singular.ok = TRUE) Call: @@ -40040,7 +40040,7 @@ y ~ a + b:c + d + e + e:d #argv <- list(structure(character(0), .Dim = c(0L, 7L), .Dimnames = list(NULL, c('description', 'class', 'mode', 'text', 'isopen', 'can read', 'can write'))));`(`(argv[[1]]); description class mode text isopen can read can write -##com.oracle.truffle.r.test.builtins.TestBuiltin_operators.testoperators207#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_operators.testoperators207# #argv <- list(structure(list(coefficients = structure(c(1.47191076131574, 0.586694550701453, NA, 0.258706725324317), .Names = c('(Intercept)', 'x1', 'x2', 'x3')), residuals = structure(c(0.224762433374997, 0.4813346401898, -0.548705796690786, -0.873306430909872, 0.3255545927283, -0.288240908441576, 0.530823516045489, -0.0649703574297026, 1.2699009772491, -1.05715266611575), .Names = c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10')), effects = structure(c(-18.0083860263211, 7.91372047070235, 0.594462796282497, -0.733976126666906, 0.546582698364345, -0.032332374655677, 0.774795104738016, 0.120246912926227, 1.34954655602521, -1.1298961521627), .Names = c('(Intercept)', 'x1', 'x3', '', '', '', '', '', '', '')), rank = 3L, fitted.values = structure(c(2.08447598454963, 2.74878255284838, 3.46483046621199, 4.23261972464046, 5.0521503281338, 5.923422276692, 6.84643557031507, 7.821190209003, 8.84768619275579, 9.92592352157344), .Names = c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10')), assign = 0:3, qr = structure(list( qr = structure(c(-3.16227766016838, 0.316227766016838, 0.316227766016838, 0.316227766016838, 0.316227766016838, 0.316227766016838, 0.316227766016838, 0.316227766016838, 0.316227766016838, 0.316227766016838, -17.3925271309261, 9.08295106229247, 0.15621147358221, 0.0461150970695743, -0.0639812794430617, -0.174077655955698, -0.284174032468334, -0.39427040898097, -0.504366785493606, -0.614463162006242, -12.1747689916483, 9.99124616852172, 2.29782505861521, 0.388354773181155, 0.471167347118467, 0.46694109307793, 0.375676011059543, 0.197372101063308, -0.0679706369107753, -0.420352202862709, -17.3925271309261, 9.08295106229247, 1.30962518065979e-16, -1.00907321685019e-15, 0.0501848681992808, -0.170313338748631, 0.0400139169574381, -0.419073670426332, -0.887431917453648, -0.0447724572319277), .Dim = c(10L, 4L), .Dimnames = list(c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'), c('(Intercept)', 'x1', 'x3', 'x2')), assign = 0:3), qraux = c(1.31622776601684, 1.26630785009485, 1.21850337126599, 1.04136435435488 ), pivot = c(1L, 2L, 4L, 3L), tol = 1e-07, rank = 3L), .Names = c('qr', 'qraux', 'pivot', 'tol', 'rank'), class = 'qr'), df.residual = 7L, xlevels = structure(list(), .Names = character(0)), call = quote(lm(formula = y ~ x1 + x2 + x3)), terms = quote(y ~ x1 + x2 + x3), model = structure(list(y = c(2.30923841792462, 3.23011719303818, 2.9161246695212, 3.35931329373059, 5.3777049208621, 5.63518136825043, 7.37725908636056, 7.75621985157329, 10.1175871700049, 8.86877085545769), x1 = 1:10, x2 = 1:10, x3 = c(0.1, 0.4, 0.9, 1.6, 2.5, 3.6, 4.9, 6.4, 8.1, 10)), .Names = c('y', 'x1', 'x2', 'x3'), terms = quote(y ~ x1 + x2 + x3), row.names = c(NA, 10L), class = 'data.frame')), .Names = c('coefficients', 'residuals', 'effects', 'rank', 'fitted.values', 'assign', 'qr', 'df.residual', 'xlevels', 'call', 'terms', 'model'), class = 'lm'));`(`(argv[[1]]); Call: @@ -44331,7 +44331,7 @@ $summary [13] -0.80942879 1.39969713 0.43065679 0.19581825 -0.06228429 0.57841339 [19] 2.31951400 2.93765524 -##com.oracle.truffle.r.test.builtins.TestBuiltin_print.testprint5#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_print.testprint5# #argv <- structure(list(x = structure(list(statistic = structure(0.87901108669074, .Names = 't'), parameter = structure(19, .Names = 'df'), p.value = 0.390376937081292, conf.int = structure(c(-0.332667989442433, 0.814407243771461), conf.level = 0.95), estimate = structure(0.240869627164514, .Names = 'mean of x'), null.value = structure(0, .Names = 'mean'), alternative = 'two.sided', method = 'One Sample t-test', data.name = 'x'), .Names = c('statistic', 'parameter', 'p.value', 'conf.int', 'estimate', 'null.value', 'alternative', 'method', 'data.name'), class = 'htest')), .Names = 'x');do.call('print', argv) One Sample t-test @@ -68095,7 +68095,7 @@ Test for independence of all factors: Min. 1st Qu. Median Mean 3rd Qu. Max. 4.600 5.100 5.150 5.236 5.400 5.800 -##com.oracle.truffle.r.test.builtins.TestBuiltin_summary.testsummary3#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_summary.testsummary3# #argv <- structure(list(object = structure(list(Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4, 4.6, 5, 4.4, 4.9, 5.4, 4.8, 4.8, 4.3,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 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c('setosa', 'versicolor', 'virginica'), class = 'factor')), .Names = c('Sepal.Length', 'Sepal.Width', 'Petal.Length', 'Petal.Width', 'Species'), row.names = c(NA, -150L), class = 'data.frame')), .Names = 'object');do.call('summary', argv) Sepal.Length Sepal.Width Petal.Length Petal.Width Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100 @@ -143656,6 +143656,85 @@ see '?methods' for accessing help and source code #0xa.p2 [1] 40 +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#``(1) +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#as.symbol('')) +Error: unexpected ')' in "as.symbol(''))" + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#e <- quote(b(f=1,foo)); names(e) <- c('','',''); e +b(1, foo) + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#e <- quote(b(f=1,foo)); names(e) <- c('','f',''); e +b(f = 1, foo) + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols#Output.IgnoreErrorMessage# +#e <- quote(x <- 1); e[[2]] <- as.symbol(''); +Error in as.symbol("") : attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols#Output.IgnoreErrorMessage# +#f <- function(){ function('') cat(asdf=1) } +Error: unexpected string constant in "f <- function(){ function(''" + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#f <- function(){ function() cat(``=1) } +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#f <- function(){ function() cat(asdf=1) } + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#f <- function(){ function(``) cat(asdf=1) } +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#f <- function(){ function(``=1) 1 } +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#f <- function(){ function(``=1) cat(``=1) } +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#names(e) +Error: object 'e' not found + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#quote(``(1)) +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#quote(``:::a) +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#quote(a$'') +a$"" + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#quote(a$``) +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#quote(a$b) +a$b + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#quote(a:::``) +Error: attempt to use zero-length variable name + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#quote(a:::a) +a:::a + +##com.oracle.truffle.r.test.parser.TestParser.testEmptySymbols# +#quote(x <- 1) +x <- 1 + ##com.oracle.truffle.r.test.parser.TestParser.testHexLiterals# #+0xFFF [1] 4095 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 c68a0188632178498a05af8e4ae893ddfe2fa08b..b68f29703af3cd8971f6bab78b1da0d13c00efee 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 @@ -105,6 +105,30 @@ public class TestParser extends TestBase { assertEval(Output.IgnoreErrorMessage, "a <- 1:100; y <- 2; z <- 5; x <- (a[[{y \n * z}]])"); } + @Test + public void testEmptySymbols() { + assertEval("names(e)"); + assertEval("e <- quote(b(f=1,foo)); names(e) <- c('','f',''); e"); + assertEval("e <- quote(b(f=1,foo)); names(e) <- c('','',''); e"); + assertEval("f <- function(){ function(``=1) 1 }"); + assertEval("f <- function(){ function(``=1) cat(``=1) }"); + assertEval("f <- function(){ function() cat(``=1) }"); + assertEval("f <- function(){ function() cat(asdf=1) }"); + assertEval("f <- function(){ function(``) cat(asdf=1) }"); + assertEval(Output.IgnoreErrorMessage, "f <- function(){ function('') cat(asdf=1) }"); + assertEval("``(1)"); + assertEval("quote(``(1))"); + assertEval("quote(a$b)"); + assertEval("quote(a$``)"); + assertEval("quote(a$'')"); + assertEval("quote(``:::a)"); + assertEval("quote(a:::a)"); + assertEval("quote(a:::``)"); + assertEval("quote(x <- 1)"); + assertEval(Output.IgnoreErrorMessage, "e <- quote(x <- 1); e[[2]] <- as.symbol(''); "); + assertEval("as.symbol(''))"); + } + @Test public void testLexerError() { // FastR provides a more accurate error message