Skip to content

Commit

Permalink
[GR-12251] Clean up deprecated methods in TRegex after adding Python …
Browse files Browse the repository at this point in the history
…flavor support.

PullRequest: graal/2377
  • Loading branch information
jirkamarsik committed Oct 25, 2018
2 parents dd7d122 + 994998f commit 7d7593c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ public CachingRegexEngine(RegexCompiler compiler, RegexOptions options) {
super(compiler, options);
}

// Compatibility for Graal.js. To be dropped once Graal.js switches to the other constructor.
@Deprecated
public CachingRegexEngine(RegexCompiler compiler, boolean eagerCompilation) {
this(compiler, RegexOptions.newBuilder().regressionTestMode(eagerCompilation).build());
}

@Override
public RegexObject compile(RegexSource regexSource) throws RegexSyntaxException, UnsupportedRegexException {
CompilationResult<RegexObject> result = cacheGet(regexSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ public class RegexEngine implements RegexLanguageObject {
private final RegexCompiler compiler;
private final RegexOptions options;

@Deprecated
public RegexEngine(RegexCompiler compiler, boolean eagerCompilation) {
this.compiler = compiler;
this.options = eagerCompilation ? RegexOptions.parse("RegressionTestMode=true") : RegexOptions.DEFAULT;
}

public RegexEngine(RegexCompiler compiler, RegexOptions options) {
this.compiler = compiler;
this.options = options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,4 @@ public final RegexResult execute(VirtualFrame frame) {
}

protected abstract RegexResult execute(VirtualFrame frame, RegexObject regex, Object input, int fromIndex);

// Compatibility for Graal.js. To be dropped once Graal.js loses the override in
// JoniRegexExecRootNode.
@Deprecated
@SuppressWarnings("unused")
protected boolean sourceIsUnicode(RegexObject regex) {
return getSource().getFlags().isUnicode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,21 @@ public RegexSource(String pattern) {
this(pattern, "");
}

// Compatibility for Graal.js. To be dropped once Graal.js switches to the first constructor.
@Deprecated
public RegexSource(String pattern, RegexFlags flags) {
this(pattern, flags.getSource());
}

public String getPattern() {
return pattern;
}

public RegexFlags getFlags() {
return RegexFlags.parseFlags(flags);
public String getFlags() {
return flags;
}

/**
* The return type of getFlags will be changed to String in order to support flags of other
* regular expression dialects. However, this would break the current usage in Graal.js.
* Therefore, getFlags() still returns the parsed ECMAScript flags as a RegexFlags object and a
* new method is introduced for accessing the flag source as a String.
*
* Once Graal.js migrates to this new method, the return type of getFlags can be changed, and
* once everyone migrates to using that, this method can be dropped.
*
* TODO: Remove this once the return type of getFlags has been changed to String.
* Deprecated.
* <p>
* TODO: Remove this once it is no longer used by Graal.js.
*/
public String getGeneralFlags() {
return flags;
return getFlags();
}

public Source getSource() {
Expand Down
4 changes: 2 additions & 2 deletions vm/mx.vm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"name": "graal-nodejs",
"subdir": True,
"dynamic": True,
"version": "0c778c17db32eff91b631c9a08f254556a86a952",
"version": "e03edeb4898836b20148f074c9143087c25cd431",
"urls" : [
{"url" : "https://github.com/graalvm/graaljs.git", "kind" : "git"},
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
Expand All @@ -29,7 +29,7 @@
"name": "graal-js",
"subdir": True,
"dynamic": True,
"version": "0c778c17db32eff91b631c9a08f254556a86a952",
"version": "e03edeb4898836b20148f074c9143087c25cd431",
"urls": [
{"url": "https://github.com/graalvm/graaljs.git", "kind" : "git"},
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
Expand Down

0 comments on commit 7d7593c

Please sign in to comment.