Skip to content

Commit

Permalink
[Truffle] Add an annotation for CoreMethod that only exist in Rubinius.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Mar 3, 2015
1 parent 596a74a commit 2c2bc0f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Expand Up @@ -241,6 +241,7 @@ public Object match(RubyRegexp regexp, RubyString string) {

}

@RubiniusOnly
@CoreMethod(names = "match_start", required = 2)
public abstract static class MatchStartNode extends CoreMethodNode {

Expand Down Expand Up @@ -323,6 +324,7 @@ public RubyString quote(RubySymbol raw) {

}

@RubiniusOnly
@CoreMethod(names = "search_from", required = 2)
public abstract static class SearchFromNode extends CoreMethodNode {

Expand Down
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General Public License version 2.1
*/
package org.jruby.truffle.nodes.core;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* A method that only exists in Rubinius but not in normal Ruby.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface RubiniusOnly {
}

2 comments on commit 2c2bc0f

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I thought you were talking about annotating the Rubinius methods in their Ruby source code - maybe we should do that as well.

@eregon
Copy link
Member Author

@eregon eregon commented on 2c2bc0f Mar 3, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would be nice to "annotate" them somehow too.

Please sign in to comment.