Skip to content
Snippets Groups Projects
Commit 6abac275 authored by Lukas Stadler's avatar Lukas Stadler
Browse files

small cleanups

parent 7d332dc0
Branches
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ public abstract class CRC64 extends RBuiltinNode {
@Override
protected void createCasts(CastBuilder casts) {
casts.arg("x").mustNotBeNull(RError.NO_CALLER, Message.INPUT_MUST_BE_STRING).mustBe(stringValue(), RError.NO_CALLER, Message.INPUT_MUST_BE_STRING);
casts.arg("x").defaultError(RError.NO_CALLER, Message.INPUT_MUST_BE_STRING).mustNotBeNull().mustBe(stringValue());
}
@Specialization
......
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -114,10 +114,7 @@ public abstract class RBuiltinNode extends RBaseNode {
*/
public RSyntaxElement getOriginalCall() {
Node p = getParent();
while (true) {
if (p == null) {
return null;
}
while (p != null) {
if (p instanceof RSyntaxCall) {
RSyntaxCall call = (RSyntaxCall) p;
if (call.getSyntaxArguments().length > 0 && call.getSyntaxLHS() instanceof RSyntaxLookup && ((RSyntaxLookup) call.getSyntaxLHS()).getIdentifier().equals(".Internal")) {
......@@ -128,6 +125,7 @@ public abstract class RBuiltinNode extends RBaseNode {
}
p = p.getParent();
}
return null;
}
@Override
......
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -42,8 +42,7 @@ public abstract class UnaryArithmeticBuiltinNode extends RBuiltinNode implements
}
protected UnaryArithmeticBuiltinNode(RType minPrecedence) {
unaryNode = UnaryArithmeticNodeGen.create(this, minPrecedence, RError.Message.ARGUMENTS_PASSED_0_1,
new Object[]{getRBuiltin().name()});
unaryNode = UnaryArithmeticNodeGen.create(this, minPrecedence, RError.Message.ARGUMENTS_PASSED, new Object[]{0, "'" + getRBuiltin().name() + "'", 1});
}
@Specialization
......@@ -116,5 +115,4 @@ public abstract class UnaryArithmeticBuiltinNode extends RBuiltinNode implements
protected double opd(double re, double im) {
throw new UnsupportedOperationException();
}
}
......@@ -573,8 +573,6 @@ public final class RError extends RuntimeException {
INCOMPATIBLE_METHODS("incompatible methods (\"%s\", \"%s\") for \"%s\""),
RECURSIVE_INDEXING_FAILED("recursive indexing failed at level %d"),
ARGUMENTS_PASSED("%d arguments passed to %s which requires %d"),
ARGUMENTS_PASSED_0_1("0 arguments passed to '%s' which requires 1"),
ARGUMENTS_PASSED_INTERNAL_0_1("0 arguments passed to .Internal(%s) which requires 1"),
ARGUMENT_IGNORED("argument '%s' will be ignored"),
NOT_CHARACTER_VECTOR("'%s' must be a character vector"),
WRONG_WINSLASH("'winslash' must be '/' or '\\\\\\\\'"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment