diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Abbrev.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Abbrev.java new file mode 100644 index 0000000000000000000000000000000000000000..4c0c63334a610c5e90bb63b2e0b7ae76dd119e0a --- /dev/null +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Abbrev.java @@ -0,0 +1,169 @@ +/* + * This material is distributed under the GNU General Public License + * Version 2. You may review the terms of this license at + * http://www.gnu.org/licenses/gpl-2.0.html + * + * Copyright (c) 1995, 1996 Robert Gentleman and Ross Ihaka + * Copyright (c) 1997-2014, The R Core Team + * Copyright (c) 2016, Oracle and/or its affiliates + * + * All rights reserved. + */ +package com.oracle.truffle.r.nodes.builtin.base; + +import static com.oracle.truffle.r.nodes.builtin.CastBuilder.Predef.*; +import static com.oracle.truffle.r.runtime.builtins.RBehavior.PURE; +import static com.oracle.truffle.r.runtime.builtins.RBuiltinKind.INTERNAL; + +import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.r.nodes.builtin.CastBuilder; +import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; +import com.oracle.truffle.r.runtime.builtins.RBuiltin; +import com.oracle.truffle.r.runtime.data.RAttributeProfiles; +import com.oracle.truffle.r.runtime.data.RDataFactory; +import com.oracle.truffle.r.runtime.data.RStringVector; +import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector; +import com.oracle.truffle.r.runtime.ops.na.NACheck; + +@RBuiltin(name = "abbreviate", kind = INTERNAL, parameterNames = {"x", "minlength", "use.classes"}, behavior = PURE) +public abstract class Abbrev extends RBuiltinNode { + private final NACheck naCheck = NACheck.create(); + private final RAttributeProfiles attrProfiles = RAttributeProfiles.create(); + + @Override + public void createCasts(CastBuilder casts) { + casts.arg("x").mustBe(stringValue()); + casts.arg("minlength").asIntegerVector().findFirst().notNA(); + casts.arg("use.classes").asLogicalVector().findFirst().notNA().map(toBoolean()); + } + + @Specialization + protected RStringVector abbrev(RAbstractStringVector x, int minlength, boolean useClasses) { + int len = x.getLength(); + String[] data = new String[len]; + naCheck.enable(true); + for (int i = 0; i < len; i++) { + String el = x.getDataAt(i); + if (naCheck.check(el)) { + data[i] = el; + } else { + if (el.length() > minlength) { + data[i] = stripChars(el, minlength, useClasses); + } else { + data[i] = el; + } + } + } + RStringVector result = RDataFactory.createStringVector(data, naCheck.neverSeenNA()); + result.copyAttributesFrom(attrProfiles, x); + return result; + } + + private static boolean firstChar(StringBuilder s, int i) { + return Character.isSpaceChar(s.charAt(i - 1)); + } + + private static boolean lastChar(StringBuilder s, int i) { + return !Character.isSpaceChar(s.charAt(i - 1)) && (i + 1 >= s.length() || Character.isSpaceChar(s.charAt(i + 1))); + } + + private static boolean lcVowel(StringBuilder s, int i) { + char ch = s.charAt(i); + return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u'; + } + + private static void shiftDown(StringBuilder s, int i) { + int len = s.length(); + for (int j = i; j < len - 1; j++) { + s.setCharAt(j, s.charAt(j + 1)); + } + s.deleteCharAt(len - 1); + } + + private static String stripChars(String inchar, int minlen, boolean usecl) { + StringBuilder s = new StringBuilder(inchar.trim()); + int len = s.length(); + int i; + int j; + int nspace = 0; + + if (len >= minlen) { + // This "loop" exists solely to allow a "break" out of the subsequent logic + donesc: while (true) { + /* The for() loops never touch the first character */ + + /* record spaces for removal later (as they act as word boundaries) */ + for (i = s.length() - 1; i > 0; i--) { + if (Character.isSpaceChar(s.charAt(i))) { + nspace++; + } + if (s.length() - nspace <= minlen) + break donesc; + } + + if (usecl) { + /* + * remove l/case vowels, which are not at the beginning of a word but are at the + * end + */ + for (i = s.length() - 1; i > 0; i--) { + if (lcVowel(s, i) && lastChar(s, i)) + shiftDown(s, i); + if (s.length() - nspace <= minlen) + break donesc; + } + + /* remove those not at the beginning of a word */ + for (i = s.length() - 1; i > 0; i--) { + if (lcVowel(s, i) && !firstChar(s, i)) + shiftDown(s, i); + if (s.length() - nspace <= minlen) + break donesc; + } + + /* Now do the same for remaining l/case chars */ + for (i = s.length() - 1; i > 0; i--) { + if (Character.isLowerCase(s.charAt(i)) && lastChar(s, i)) { + shiftDown(s, i); + } + if (s.length() - nspace <= minlen) { + break donesc; + } + } + + for (i = s.length() - 1; i > 0; i--) { + if (Character.isLowerCase(s.charAt(i)) && !firstChar(s, i)) { + shiftDown(s, i); + } + if (s.length() - nspace <= minlen) { + break donesc; + } + } + } + + /* all else has failed so we use brute force */ + + for (i = s.length() - 1; i > 0; i--) { + if (!firstChar(s, i) && !Character.isSpaceChar(s.charAt(i))) { + shiftDown(s, i); + } + if (s.length() - nspace <= minlen) { + break; + } + } + } + } + + // remove internal spaces as required + int upper = s.length(); + if (upper > minlen) { + for (i = upper - 1; i > 0; i--) { + if (Character.isSpaceChar(s.charAt(i))) { + shiftDown(s, i); + } + } + } + return s.toString(); + } + +} diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Internal.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Internal.java index 9c5182a17b244be2a0c47430cb079ea7197c68d3..e5a98a22eb71cae46ddad53897953989485cd5c9 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Internal.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Internal.java @@ -125,13 +125,13 @@ public abstract class Internal extends RBuiltinNode { "pweibull", "qweibull", "dnchisq", "pnchisq", "qnchisq", "dnt", "pnt", "qnt", "dwilcox", "pwilcox", "qwilcox", "besselI", "besselK", "dnbinom_mu", "pnbinom_mu", "qnbinom_mu", "dhyper", "phyper", "qhyper", "dnbeta", "pnbeta", "qnbeta", "dnf", "pnf", "qnf", "dtukey", "ptukey", "qtukey", "rchisq", "rexp", "rgeom", "rpois", "rt", "rsignrank", "rbeta", "rbinom", "rcauchy", "rf", "rgamma", "rlnorm", "rlogis", "rnbinom", "rnbinom_mu", "rnchisq", "rnorm", "runif", "rweibull", "rwilcox", "rhyper", "sample2", "format.info", - "abbreviate", "grepRaw", "regexec", "adist", "aregexec", "chartr", "intToBits", "rawToBits", "packBits", "utf8ToInt", "intToUtf8", "strtrim", "eapply", "machine", "save", + "grepRaw", "regexec", "adist", "aregexec", "chartr", "intToBits", "rawToBits", "packBits", "utf8ToInt", "intToUtf8", "strtrim", "eapply", "machine", "save", "saveToConn", "dput", "dump", "prmatrix", "gcinfo", "gctorture", "gctorture2", "memory.profile", "recordGraphics", "sys.calls", "sys.on.exit", "rank", "builtins", "bodyCode", "rapply", "islistfactor", "inspect", "mem.limits", "merge", "capabilitiesX11", "Cstack_info", "file.show", "file.choose", "polyroot", "mkCode", "bcClose", "is.builtin.internal", "disassemble", "bcVersion", "load.from.file", "save.to.file", "growconst", "putconst", "getconst", "enableJIT", "setNumMathThreads", "setMaxNumMathThreads", "isatty", "isIncomplete", "pipe", "fifo", "bzfile", "xzfile", "unz", "truncate", "rawConnection", "rawConnectionValue", "sockSelect", "gzcon", "memCompress", "memDecompress", "mkUnbound", "env.profile", "setTimeLimit", "setSessionTimeLimit", "icuSetCollate", "lazyLoadDBflush", "findInterval", "pretty", "crc64", "rowsum_matrix", "rowsum_df", "setS4Object", - "traceOnOff", "La_qr_cmplx", "La_rs", "La_rs_cmplx", "La_rg_cmplx", "La_rs", "La_rs_cmplx", "La_dlange", "La_dgecon", "La_dtrcon", "La_zgecon", "La_ztrcon", "La_solve_cmplx", + "traceOnOff", "La_qr_cmplx", "La_rs_cmplx", "La_rg_cmplx", "La_rs", "La_rs_cmplx", "La_dlange", "La_dgecon", "La_dtrcon", "La_zgecon", "La_ztrcon", "La_solve_cmplx", "La_chol2inv", "qr_qy_real", "qr_coef_cmplx", "qr_qy_cmpl", "La_svd", "La_svd_cmplx"}; } 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 ad7bb4866368061de942da405c079d5a6e2ab34c..9af4df8ade2df0f8e35a45229f529560b1807124 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 @@ -1448,24 +1448,24 @@ Error: invalid 'locale' argument ##com.oracle.truffle.r.test.builtins.TestBuiltin_Sysunsetenv.testSysunsetenv3#Ignored.SideEffects# #argv <- list(character(0)); .Internal(Sys.unsetenv(argv[[1]])) -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate1#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate1# #argv <- list('text', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "text" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate10#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate10# #argv <- list('filled.contour', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "flld.c" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate11#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate11# #argv <- list(c('Svansota', 'No. 462', 'Manchuria', 'No. 475', 'Velvet', 'Peatland', 'Glabron', 'No. 457', 'Wisconsin No. 38', 'Trebi'), 5, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "Svnst" "N.462" "Mnchr" "N.475" "Velvt" "Ptlnd" "Glbrn" "N.457" "WN.38" [10] "Trebi" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate12#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate12# #argv <- list('dtrMatrix-class', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "dtrMt-" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate2#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate2# #argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 3, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "Alb" "Als" "Arz" "Ark" "Clf" "Clr" "Cnn" "Dlw" "Flr" "Grg" "Haw" "Idh" [13] "Ill" "Ind" "Iow" "Kns" "Knt" "Lsn" "Man" "Mry" "Mss" "Mch" "Mnn" "Mss" @@ -1473,15 +1473,15 @@ Error: invalid 'locale' argument [37] "Org" "Pnn" "RhI" "StC" "StD" "Tnn" "Txs" "Uth" "Vrm" "Vrg" "Wsh" "WsV" [49] "Wsc" "Wym" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate3#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate3# #argv <- list('glm', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "glm" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate4#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate4# #argv <- list(c('(Intercept)', 'sin(2 * pi * Time)', 'cos(2 * pi * Time)'), 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "(Intr)" "s(*p*T" "c(*p*T" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate5#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate5# #argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "Albm" "Alsk" "Arzn" "Arkn" "Clfr" "Clrd" "Cnnc" "Dlwr" "Flrd" "Gerg" [11] "Hawa" "Idah" "Illn" "Indn" "Iowa" "Knss" "Kntc" "Losn" "Main" "Mryl" @@ -1489,7 +1489,7 @@ Error: invalid 'locale' argument [31] "NwMx" "NwYr" "NrtC" "NrtD" "Ohio" "Oklh" "Orgn" "Pnns" "RhdI" "SthC" [41] "SthD" "Tnns" "Texs" "Utah" "Vrmn" "Vrgn" "Wshn" "WstV" "Wscn" "Wymn" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate6#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate6# #argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 3L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "Alb" "Als" "Arz" "Ark" "Clf" "Clr" "Cnn" "Dlw" "Flr" "Grg" "Haw" "Idh" [13] "Ill" "Ind" "Iow" "Kns" "Knt" "Lsn" "Man" "Mry" "Mss" "Mch" "Mnn" "Mss" @@ -1497,19 +1497,19 @@ Error: invalid 'locale' argument [37] "Org" "Pnn" "RhI" "StC" "StD" "Tnn" "Txs" "Uth" "Vrm" "Vrg" "Wsh" "WsV" [49] "Wsc" "Wym" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate7#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate7# #argv <- list(c('1_', 'Weight', 'Cylinders4', 'Cylinders5', 'Cylinders6', 'Cylinders8', 'Cylindersrotary', 'TypeLarge', 'TypeMidsize', 'TypeSmall', 'TypeSporty', 'TypeVan', 'EngineSize', 'DriveTrainFront', 'DriveTrainRear'), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "1_" "Wght" "Cyl4" "Cyl5" "Cyl6" "Cyl8" "Cyln" "TypL" "TypM" "TypS" [11] "TypS" "TypV" "EngS" "DrTF" "DrTR" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate8#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate8# #argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 1L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) [1] "A" "A" "A" "A" "C" "C" "C" "D" "F" "G" "H" "I" "I" "I" "I" [16] "K" "K" "L" "M" "M" "M" "M" "M" "M" "M" "M" "N" "N" "NH" "NJ" [31] "NM" "NY" "NC" "ND" "O" "O" "O" "P" "RI" "SC" "SD" "T" "T" "U" "V" [46] "V" "W" "WV" "W" "W" -##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate9#Ignored.MissingBuiltin# +##com.oracle.truffle.r.test.builtins.TestBuiltin_abbreviate.testabbreviate9# #argv <- list(character(0), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]])) character(0) @@ -24924,7 +24924,7 @@ FALSE FALSE #argv <- list(structure(list(Topic = c('myTst-package', 'foo-class', 'myTst', 'show,foo-method', 'show,foo-method', 'show-methods'), File = c('myTst-package', 'foo-class', 'myTst-package', 'foo-class', 'show-methods', 'show-methods')), .Names = c('Topic', 'File'), row.names = c(3L, 1L, 4L, 2L, 6L, 5L), class = 'data.frame'));is.matrix(argv[[1]]); [1] FALSE -##com.oracle.truffle.r.test.builtins.TestBuiltin_isna.testIsNA#Ignored.Unimplemented# +##com.oracle.truffle.r.test.builtins.TestBuiltin_isna.testIsNA# #is.na(data.frame(col1=1:5, col2=c(NA, 1, NA, 2, NA))) col1 col2 [1,] FALSE TRUE @@ -25040,7 +25040,7 @@ FALSE [445] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [457] FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE -##com.oracle.truffle.r.test.builtins.TestBuiltin_isna.testisna13#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_isna.testisna13# #argv <- list(structure(list(VAR1 = c(1, 2, 3, 4, 5), VAR3 = c(1, 1, 1, 1, NA)), .Names = c('VAR1', 'VAR3'), class = 'data.frame', row.names = c(NA, -5L)));is.na(argv[[1]]); VAR1 VAR3 [1,] FALSE FALSE @@ -25409,7 +25409,7 @@ logical(0) #argv <- list(complex(real = 3, imaginary = -Inf));do.call('is.null', argv) [1] FALSE -##com.oracle.truffle.r.test.builtins.TestBuiltin_isnull.testisnull16#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestBuiltin_isnull.testisnull16# #argv <- list(function(file = ifelse(onefile, 'Rplots.pdf', 'Rplot%03d.pdf'), width, height, onefile, family, title, fonts, version, paper, encoding, bg, fg, pointsize, pagecentre, colormodel, useDingbats, useKerning, fillOddEven, compress) { invisible() });do.call('is.null', argv) [1] FALSE @@ -26849,7 +26849,7 @@ Error in lengths(quote(a)) : 'x' must be a list or atomic vector #{ x <- 1 ; levels(x)<-4.5; levels(x);} [1] 4.5 -##com.oracle.truffle.r.test.builtins.TestBuiltin_levels.testLevels# +##com.oracle.truffle.r.test.builtins.TestBuiltin_levels.testLevels#Output.IgnoreErrorContext# #{ x <- 1 ; levels(x)<-NULL; levels(notx)} Error in levels(notx) : object 'notx' not found @@ -39789,7 +39789,7 @@ V 0.0cwt 0.2cwt 0.4cwt 0.6cwt #argv <- list(NULL, NULL, TRUE, NULL, NULL, FALSE, NULL, TRUE, TRUE); .Internal(print.default(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) NULL -##com.oracle.truffle.r.test.builtins.TestBuiltin_printdefault.testprintdefault18#Ignored.OutputFormatting# +##com.oracle.truffle.r.test.builtins.TestBuiltin_printdefault.testprintdefault18# #argv <- list(quote(breaks ~ (wool + tension) - tension), NULL, TRUE, NULL, NULL, FALSE, NULL, TRUE, TRUE); .Internal(print.default(argv[[1]], argv[[2]], argv[[3]], argv[[4]], argv[[5]], argv[[6]], argv[[7]], argv[[8]], argv[[9]])) breaks ~ (wool + tension) - tension @@ -44823,14 +44823,14 @@ Error in seq.int(argv[[1]], argv[[2]], argv[[3]]) : [1] 58 0a 00 00 00 02 00 03 03 02 00 02 03 00 00 00 00 10 00 00 00 01 00 04 00 [26] 09 00 00 00 03 62 61 7a -##com.oracle.truffle.r.test.builtins.TestBuiltin_serialize.testserialize#Ignored.ImplementationError# +##com.oracle.truffle.r.test.builtins.TestBuiltin_serialize.testserialize# #options(keep.source=FALSE); serialize(quote((a %asdf% b)), connection=NULL) [1] 58 0a 00 00 00 02 00 03 03 02 00 02 03 00 00 00 00 06 00 00 00 01 00 04 00 [26] 09 00 00 00 01 28 00 00 00 02 00 00 00 06 00 00 00 01 00 04 00 09 00 00 00 [51] 06 25 61 73 64 66 25 00 00 00 02 00 00 00 01 00 04 00 09 00 00 00 01 61 00 [76] 00 00 02 00 00 00 01 00 04 00 09 00 00 00 01 62 00 00 00 fe 00 00 00 fe -##com.oracle.truffle.r.test.builtins.TestBuiltin_serialize.testserialize#Ignored.ImplementationError# +##com.oracle.truffle.r.test.builtins.TestBuiltin_serialize.testserialize# #options(keep.source=FALSE); serialize(quote((a+b)), connection=NULL) [1] 58 0a 00 00 00 02 00 03 03 02 00 02 03 00 00 00 00 06 00 00 00 01 00 04 00 [26] 09 00 00 00 01 28 00 00 00 02 00 00 00 06 00 00 00 01 00 04 00 09 00 00 00 @@ -44939,7 +44939,7 @@ Error in seq.int(argv[[1]], argv[[2]], argv[[3]]) : [76] 00 10 00 00 00 01 00 04 00 09 00 00 00 03 66 6f 6f 00 00 00 02 00 00 00 01 [101] 00 04 00 09 00 00 00 01 78 00 00 00 fe 00 00 00 02 00 00 00 fe 00 00 00 fe -##com.oracle.truffle.r.test.builtins.TestBuiltin_serialize.testserialize#Ignored.ImplementationError# +##com.oracle.truffle.r.test.builtins.TestBuiltin_serialize.testserialize# #options(keep.source=FALSE); serialize(quote(function(x) { `+`(`(`("BAR"), x) }), connection=NULL) [1] 58 0a 00 00 00 02 00 03 03 02 00 02 03 00 00 00 00 06 00 00 00 01 00 04 00 [26] 09 00 00 00 08 66 75 6e 63 74 69 6f 6e 00 00 00 02 00 00 04 02 00 00 00 01 @@ -55696,7 +55696,7 @@ $x #{ f <- function() { stop("hello","world") } ; f() } Error in f() : helloworld -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen# #{ eigen(10, only.values=FALSE) } $values [1] 10 @@ -55706,17 +55706,17 @@ $vectors [1,] 1 -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen# #{ r <- eigen(matrix(c(1,2,2,3), nrow=2), only.values=FALSE); round( r$values, digits=5 ) } [1] 4.23607 -0.23607 -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen# #{ r <- eigen(matrix(c(1,2,2,3), nrow=2), only.values=FALSE); round( r$vectors, digits=5 ) } [,1] [,2] [1,] 0.52573 -0.85065 [2,] 0.85065 0.52573 -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen# #{ r <- eigen(matrix(c(1,2,3,4), nrow=2), only.values=FALSE); round( r$values, digits=5 ) } [1] 5.37228 -0.37228 @@ -55726,21 +55726,21 @@ $vectors [1,] -0.56577 -0.90938 [2,] -0.82456 0.41597 -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen# #{ r <- eigen(matrix(c(3,-2,4,-1), nrow=2), only.values=FALSE); round( r$values, digits=5 ) } [1] 1+2i 1-2i -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen# #{ r <- eigen(matrix(c(3,-2,4,-1), nrow=2), only.values=FALSE); round( r$vectors, digits=5 ) } [,1] [,2] [1,] 0.81650+0.00000i 0.81650+0.00000i [2,] -0.40825+0.40825i -0.40825-0.40825i -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen# #{ r <- eigen(matrix(rep(1,4), nrow=2), only.values=FALSE) ; round( r$values, digits=5 ) } [1] 2 0 -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testEigen# #{ r <- eigen(matrix(rep(1,4), nrow=2), only.values=FALSE) ; round( r$vectors, digits=5 ) } [,1] [,2] [1,] 0.70711 -0.70711 @@ -56114,7 +56114,7 @@ Levels: Control Treat #{ sub <- function(x,y) { x - y }; sub(10,5) } [1] 5 -##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testParen#Ignored.Unknown# +##com.oracle.truffle.r.test.builtins.TestMiscBuiltins.testParen# #{ a = array(1,c(3,3,3)); (a[1,2,3] = 3) } [1] 3 @@ -63442,7 +63442,7 @@ $dimnames[[3]] -##com.oracle.truffle.r.test.library.base.TestSimpleAttributes.testBuiltinPropagationIgnore#Ignored.Unknown# +##com.oracle.truffle.r.test.library.base.TestSimpleAttributes.testBuiltinPropagationIgnore# #{ m <- matrix(c(1,1,1,1), nrow=2) ; attr(m,"a") <- 1 ; r <- eigen(m) ; r$vectors <- round(r$vectors, digits=5) ; r } $values [1] 2 0 diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_abbreviate.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_abbreviate.java index a411c06fea4c776c9004dc9ce605cffdcff060b3..9666cf68c7e96e5d0d268541d8f4c5477e6c8b7c 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_abbreviate.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_abbreviate.java @@ -19,67 +19,61 @@ public class TestBuiltin_abbreviate extends TestBase { @Test public void testabbreviate1() { - assertEval(Ignored.MissingBuiltin, "argv <- list('text', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list('text', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate2() { - assertEval(Ignored.MissingBuiltin, - "argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 3, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 3, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate3() { - assertEval(Ignored.MissingBuiltin, "argv <- list('glm', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list('glm', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate4() { - assertEval(Ignored.MissingBuiltin, "argv <- list(c('(Intercept)', 'sin(2 * pi * Time)', 'cos(2 * pi * Time)'), 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list(c('(Intercept)', 'sin(2 * pi * Time)', 'cos(2 * pi * Time)'), 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate5() { - assertEval(Ignored.MissingBuiltin, - "argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate6() { - assertEval(Ignored.MissingBuiltin, - "argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 3L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 3L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate7() { - assertEval(Ignored.MissingBuiltin, - "argv <- list(c('1_', 'Weight', 'Cylinders4', 'Cylinders5', 'Cylinders6', 'Cylinders8', 'Cylindersrotary', 'TypeLarge', 'TypeMidsize', 'TypeSmall', 'TypeSporty', 'TypeVan', 'EngineSize', 'DriveTrainFront', 'DriveTrainRear'), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list(c('1_', 'Weight', 'Cylinders4', 'Cylinders5', 'Cylinders6', 'Cylinders8', 'Cylindersrotary', 'TypeLarge', 'TypeMidsize', 'TypeSmall', 'TypeSporty', 'TypeVan', 'EngineSize', 'DriveTrainFront', 'DriveTrainRear'), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate8() { - assertEval(Ignored.MissingBuiltin, - "argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 1L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list(c('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 1L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate9() { - assertEval(Ignored.MissingBuiltin, "argv <- list(character(0), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list(character(0), 4L, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate10() { - assertEval(Ignored.MissingBuiltin, "argv <- list('filled.contour', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list('filled.contour', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate11() { - assertEval(Ignored.MissingBuiltin, - "argv <- list(c('Svansota', 'No. 462', 'Manchuria', 'No. 475', 'Velvet', 'Peatland', 'Glabron', 'No. 457', 'Wisconsin No. 38', 'Trebi'), 5, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list(c('Svansota', 'No. 462', 'Manchuria', 'No. 475', 'Velvet', 'Peatland', 'Glabron', 'No. 457', 'Wisconsin No. 38', 'Trebi'), 5, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } @Test public void testabbreviate12() { - assertEval(Ignored.MissingBuiltin, "argv <- list('dtrMatrix-class', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); + assertEval("argv <- list('dtrMatrix-class', 6, TRUE); .Internal(abbreviate(argv[[1]], argv[[2]], argv[[3]]))"); } } diff --git a/mx.fastr/copyrights/overrides b/mx.fastr/copyrights/overrides index c8bde97bd11395870706393258148be607852a31..98875d20766f36f2a435db8012fb744e4db9a689 100644 --- a/mx.fastr/copyrights/overrides +++ b/mx.fastr/copyrights/overrides @@ -105,6 +105,7 @@ com.oracle.truffle.r.native/run/Rclasspath.sh,oracle_bash.copyright com.oracle.truffle.r.native/run/Rscript_exec.sh,oracle_bash.copyright com.oracle.truffle.r.native/run/Rscript.sh,oracle_bash.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastrDqrls.java,gnu_r.copyright +com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Abbrev.java,gnu_r_gentleman_ihaka2.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/APerm.java,purdue.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BaseGammaFunctions.java,gnu_r_ihaka.copyright com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BaseVariables.java,gnu_r.copyright