@@ -389,8 +389,7 @@ private String getMethodName(ParserContext parserContext, MaterializedFrame pare
389
389
}
390
390
391
391
public static org .yarp .Nodes .Node parseToYARPAST (RubyContext context , RubyLanguage language , RubySource rubySource ,
392
- StaticScope blockScope ,
393
- ParserConfiguration configuration , RubyDeferredWarnings rubyWarnings ) {
392
+ StaticScope blockScope , ParserConfiguration configuration , RubyDeferredWarnings rubyWarnings ) {
394
393
// LexerSource lexerSource = new LexerSource(rubySource);
395
394
// We only need to pass in current scope if we are evaluating as a block (which
396
395
// is only done for evals). We need to pass this in so that we can appropriately scope
@@ -410,15 +409,15 @@ public static org.yarp.Nodes.Node parseToYARPAST(RubyContext context, RubyLangua
410
409
var parseResult = Loader .load (serializedBytes , yarpSource );
411
410
412
411
final String filename = rubySource .getSourcePath ();
413
- final ParseResult .Error [] errors = parseResult .getErrors () ;
412
+ final ParseResult .Error [] errors = parseResult .errors ;
414
413
415
414
// collect warnings generated by the parser
416
- for (ParseResult .Warning warning : parseResult .getWarnings () ) {
417
- Nodes .Location location = warning .getLocation () ;
415
+ for (ParseResult .Warning warning : parseResult .warnings ) {
416
+ Nodes .Location location = warning .location ;
418
417
SourceSection section = rubySource .getSource ().createSection (location .startOffset , location .length );
419
418
int lineNumber = RubySource .getStartLineAdjusted (context , section );
420
419
421
- rubyWarnings .warn (filename , lineNumber , warning .getMessage () );
420
+ rubyWarnings .warn (filename , lineNumber , warning .message );
422
421
}
423
422
424
423
if (errors .length != 0 ) {
@@ -433,9 +432,9 @@ public static org.yarp.Nodes.Node parseToYARPAST(RubyContext context, RubyLangua
433
432
// but it isn't guarantied that the first error is the most specific/relevant to user
434
433
ParseResult .Error error = errors [0 ];
435
434
436
- Nodes .Location location = error .getLocation () ;
435
+ Nodes .Location location = error .location ;
437
436
SourceSection section = rubySource .getSource ().createSection (location .startOffset , location .length );
438
- String message = context .fileLine (section ) + ": " + error .getMessage () ;
437
+ String message = context .fileLine (section ) + ": " + error .message ;
439
438
440
439
if (context != null ) {
441
440
int lineNumber = RubySource .getStartLineAdjusted (context , section );
@@ -451,7 +450,7 @@ public static org.yarp.Nodes.Node parseToYARPAST(RubyContext context, RubyLangua
451
450
}
452
451
}
453
452
454
- return parseResult .getValue () ;
453
+ return parseResult .value ;
455
454
// YARP end
456
455
457
456
// RubyParser parser = new RubyParser(lexerSource, rubyWarnings);
0 commit comments