Skip to content

Commit 86d2663

Browse files
committed
Make parseToJRubyAST() a static method to make it clear it does not a TranslatorDriver instance
1 parent 775e8c3 commit 86d2663

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/main/java/org/truffleruby/aot/ParserCache.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ private static RubySource loadSource(String feature) {
5757
}
5858

5959
private static RootParseNode parse(RubySource source) {
60-
final TranslatorDriver driver = new TranslatorDriver(null);
6160
final StaticScope staticScope = new StaticScope(StaticScope.Type.LOCAL, null);
6261
final ParserConfiguration parserConfiguration = new ParserConfiguration(null, false, true, false);
6362

64-
return driver.parseToJRubyAST(source, staticScope, parserConfiguration);
63+
return TranslatorDriver.parseToJRubyAST(null, source, staticScope, parserConfiguration);
6564
}
6665

6766
}

src/main/java/org/truffleruby/parser/TranslatorDriver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public RubyRootNode parse(RubySource rubySource, ParserContext parserContext, St
175175
node = context.getMetricsProfiler().callWithMetrics(
176176
"parsing",
177177
source.getName(),
178-
() -> parseToJRubyAST(rubySource, staticScope, parserConfiguration));
178+
() -> parseToJRubyAST(context, rubySource, staticScope, parserConfiguration));
179179
printParseTranslateExecuteMetric("after-parsing", context, source);
180180
}
181181

@@ -380,7 +380,7 @@ private String getMethodName(ParserContext parserContext, MaterializedFrame pare
380380
}
381381
}
382382

383-
public RootParseNode parseToJRubyAST(RubySource rubySource, StaticScope blockScope,
383+
public static RootParseNode parseToJRubyAST(RubyContext context, RubySource rubySource, StaticScope blockScope,
384384
ParserConfiguration configuration) {
385385
LexerSource lexerSource = new LexerSource(rubySource, configuration.getDefaultEncoding());
386386
// We only need to pass in current scope if we are evaluating as a block (which

0 commit comments

Comments
 (0)