|
1 | | -<%- string_type = Prism::Template::JAVA_STRING_TYPE -%> |
| 1 | +<%- string_type = Prism::Template::JAVA_IDENTIFIER_TYPE -%> |
2 | 2 | package org.ruby_lang.prism; |
3 | 3 |
|
4 | 4 | import java.lang.Short; |
@@ -31,7 +31,7 @@ public class Loader { |
31 | 31 | <%- if string_type == "String" -%> |
32 | 32 | return new String(bytes, encodingCharset).intern(); |
33 | 33 | <%- else -%> |
34 | | - return null; // Must be implemented by subclassing Loader |
| 34 | + return bytes; // Must be implemented by subclassing Loader |
35 | 35 | <%- end -%> |
36 | 36 | } |
37 | 37 |
|
@@ -229,7 +229,7 @@ public class Loader { |
229 | 229 | private <%= string_type %>[] loadConstants() { |
230 | 230 | int length = loadVarUInt(); |
231 | 231 | if (length == 0) { |
232 | | - return Nodes.EMPTY_STRING_ARRAY; |
| 232 | + return Nodes.EMPTY_IDENTIFIER_ARRAY; |
233 | 233 | } |
234 | 234 | <%= string_type %>[] constants = new <%= string_type %>[length]; |
235 | 235 | for (int i = 0; i < length; i++) { |
@@ -395,7 +395,7 @@ public class Loader { |
395 | 395 | int bufferPosition = buffer.position(); |
396 | 396 | int serializedLength = buffer.getInt(); |
397 | 397 | // Load everything except the body and locals, because the name, receiver, parameters are still needed for lazily defining the method |
398 | | - Nodes.DefNode lazyDefNode = new Nodes.DefNode(<%= base_params.join(", ") -%>, -bufferPosition, this, loadConstant(), loadOptionalNode(), (Nodes.ParametersNode) loadOptionalNode(), null, Nodes.EMPTY_STRING_ARRAY); |
| 398 | + Nodes.DefNode lazyDefNode = new Nodes.DefNode(<%= base_params.join(", ") -%>, -bufferPosition, this, loadConstant(), loadOptionalNode(), (Nodes.ParametersNode) loadOptionalNode(), null, Nodes.EMPTY_IDENTIFIER_ARRAY); |
399 | 399 | buffer.position(bufferPosition + serializedLength); // skip past the serialized DefNode |
400 | 400 | return lazyDefNode; |
401 | 401 | } |
|
0 commit comments