File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/main/java/org/truffleruby/interop Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 16
16
import org .truffleruby .builtins .CoreModule ;
17
17
import org .truffleruby .builtins .UnaryCoreMethodNode ;
18
18
import org .truffleruby .core .encoding .Encodings ;
19
+ import org .truffleruby .core .rope .CodeRange ;
19
20
import org .truffleruby .core .rope .Rope ;
20
21
import org .truffleruby .core .string .RubyString ;
21
22
import org .truffleruby .core .string .StringNodes ;
@@ -112,4 +113,15 @@ protected boolean isInternal(RubySourceLocation location) {
112
113
}
113
114
}
114
115
116
+ @ CoreMethod (names = "language" )
117
+ public abstract static class LanguageNode extends UnaryCoreMethodNode {
118
+ @ TruffleBoundary
119
+ @ Specialization
120
+ protected RubyString language (RubySourceLocation location ,
121
+ @ Cached StringNodes .MakeStringNode makeStringNode ) {
122
+ return makeStringNode .executeMake (location .sourceSection .getSource ().getLanguage (),
123
+ Encodings .UTF_8 , CodeRange .CR_UNKNOWN );
124
+ }
125
+ }
126
+
115
127
}
You can’t perform that action at this time.
0 commit comments