Skip to content

Commit 65fdeba

Browse files
eregonandrykonchin
authored andcommitted
Adopt WarningLevel from Prism
1 parent 681fcca commit 65fdeba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,10 @@ public static org.prism.ParseResult parseToYARPAST(RubyContext context, RubyLang
480480
SourceSection section = rubySource.getSource().createSection(location.startOffset, location.length);
481481
int lineNumber = RubySource.getStartLineAdjusted(context, section);
482482

483-
rubyWarnings.warning(filename, lineNumber, warning.message);
483+
switch (warning.level) {
484+
case WARNING_DEFAULT -> rubyWarnings.warn(filename, lineNumber, warning.message);
485+
case WARNING_VERBOSE -> rubyWarnings.warning(filename, lineNumber, warning.message);
486+
}
484487
}
485488

486489
if (errors.length != 0) {

0 commit comments

Comments
 (0)