Skip to content

Commit fa10840

Browse files
committed
Minor: Improve naming of function as suggested during review
1 parent 5394980 commit fa10840

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ private int identifier(int c, boolean commandState) {
17981798
}
17991799
tempVal = createTokenRope();
18001800

1801-
if (result == 0 && isFirstCharacterEncodingAwareUppercase(tempVal)) {
1801+
if (result == 0 && isFirstCodepointUppercase(tempVal)) {
18021802
result = RubyParser.tCONSTANT;
18031803
} else {
18041804
result = RubyParser.tIDENTIFIER;
@@ -3493,7 +3493,7 @@ public boolean update_heredoc_indent(int c) {
34933493
}
34943494

34953495
public void validateFormalIdentifier(Rope identifier) {
3496-
if (isFirstCharacterEncodingAwareUppercase(identifier)) {
3496+
if (isFirstCodepointUppercase(identifier)) {
34973497
compile_error("formal argument cannot be a constant");
34983498
}
34993499

@@ -3665,9 +3665,9 @@ protected boolean isSpaceArg(int c, boolean spaceSeen) {
36653665
return isARG() && spaceSeen && !Character.isWhitespace(c);
36663666
}
36673667

3668-
/** Encoding-aware (including multi-byte encodings) check of first character of a given rope, usually to determine
3668+
/** Encoding-aware (including multi-byte encodings) check of first codepoint of a given rope, usually to determine
36693669
* if it is a constant */
3670-
private boolean isFirstCharacterEncodingAwareUppercase(Rope rope) {
3670+
private boolean isFirstCodepointUppercase(Rope rope) {
36713671
byte[] ropeBytes = rope.getBytes();
36723672
int firstCharacter = rope.encoding.mbcToCode(ropeBytes, 0, ropeBytes.length);
36733673
return rope.encoding.isUpper(firstCharacter);

0 commit comments

Comments
 (0)