Skip to content

Commit cb26e29

Browse files
committed
Remove dead code as the result of recent cleanups
1 parent abd6d2c commit cb26e29

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/main/java/org/truffleruby/language/loader/CodeLoader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ public CodeLoader(RubyLanguage language, RubyContext context) {
5353
@TruffleBoundary
5454
public RootCallTarget parseTopLevelWithCache(RubySource rubySource, Node currentNode) {
5555
final Source source = rubySource.getSource();
56-
var tstringWithEncoding = rubySource.getTStringWithEncoding();
57-
5856
final String path = RubyLanguage.getPath(source);
57+
5958
if (language.singleContext && !alreadyLoadedInContext.add(language.getPathRelativeToHome(path))) {
6059
/* Duplicate load of the same file in the same context, we cannot use the cache because it would re-assign
6160
* the live modules of static LexicalScopes and we cannot/do not want to invalidate static LexicalScopes, so

src/main/java/org/truffleruby/parser/lexer/RubyLexer.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
import com.oracle.truffle.api.strings.TruffleString;
6161
import com.oracle.truffle.api.strings.TruffleString.ErrorHandling;
6262
import org.jcodings.Encoding;
63-
import org.jcodings.specific.USASCIIEncoding;
6463
import org.jcodings.specific.UTF8Encoding;
6564
import org.truffleruby.RubyContext;
6665
import org.truffleruby.annotations.SuppressFBWarnings;
@@ -464,10 +463,6 @@ protected void setEncoding(TruffleString name) {
464463
setEncoding(newEncoding);
465464
}
466465

467-
private boolean isUTF8Subset(Encoding encoding) {
468-
return encoding == UTF8Encoding.INSTANCE || encoding == USASCIIEncoding.INSTANCE;
469-
}
470-
471466
private RuntimeException argumentError(RubyContext context, String message) {
472467
if (context != null) {
473468
return new RaiseException(context, context.getCoreExceptions().argumentError(message, null));
@@ -1400,20 +1395,6 @@ public boolean onMagicComment(String name, TruffleString value) {
14001395
return false;
14011396
}
14021397

1403-
private static boolean isKnownMagicComment(String name) {
1404-
if (isMagicEncodingComment(name)) {
1405-
return true;
1406-
} else if ("frozen_string_literal".equalsIgnoreCase(name)) {
1407-
return true;
1408-
} else if ("warn_indent".equalsIgnoreCase(name)) {
1409-
return true;
1410-
} else if ("truffleruby_primitives".equalsIgnoreCase(name)) {
1411-
return true;
1412-
} else {
1413-
return false;
1414-
}
1415-
}
1416-
14171398
public static boolean isMagicEncodingComment(String name) {
14181399
return "coding".equalsIgnoreCase(name) || "encoding".equalsIgnoreCase(name);
14191400
}

0 commit comments

Comments
 (0)