Skip to content

Commit

Permalink
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 0 additions & 5 deletions spec/truffle/tags/core/regexp/fixed_encoding_tags.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
fails:Regexp#fixed_encoding? returns false by default
fails:Regexp#fixed_encoding? returns false if the 'n' modifier was supplied to the Regexp
fails:Regexp#fixed_encoding? returns true if the 'u' modifier was supplied to the Regexp
fails:Regexp#fixed_encoding? returns true if the 's' modifier was supplied to the Regexp
fails:Regexp#fixed_encoding? returns true if the 'e' modifier was supplied to the Regexp
fails:Regexp#fixed_encoding? returns true if the Regexp contains a \u escape
fails:Regexp#fixed_encoding? returns true if the Regexp contains a UTF-8 literal
fails:Regexp#fixed_encoding? returns true if the Regexp was created with the Regexp::FIXEDENCODING option
Original file line number Diff line number Diff line change
@@ -29,6 +29,20 @@
*/
public abstract class RegexpPrimitiveNodes {

@RubiniusPrimitive(name = "regexp_fixed_encoding_p")
public static abstract class RegexpFixedEncodingPrimitiveNode extends RubiniusPrimitiveNode {

public RegexpFixedEncodingPrimitiveNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@Specialization
public boolean fixedEncoding(RubyRegexp regexp) {
return regexp.getOptions().isFixed();
}

}

@RubiniusPrimitive(name = "regexp_initialize")
public static abstract class RegexpInitializePrimitiveNode extends RubiniusPrimitiveNode {

0 comments on commit 75c60c8

Please sign in to comment.