File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/noppes/npcs/client/gui/util/script Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,8 @@ private boolean isFieldAccess(int position) {
373373 private boolean isMethodCall (int position ) {
374374 // Skip whitespace after identifier
375375 int i = position ;
376- while (i < text .length () && Character .isLetterOrDigit (text .charAt (i )) || text .charAt (i ) == '_' ) {
376+ // Note: parentheses needed to avoid evaluating text.charAt(i) when i >= text.length()
377+ while (i < text .length () && (Character .isLetterOrDigit (text .charAt (i )) || text .charAt (i ) == '_' )) {
377378 i ++;
378379 }
379380 // Skip whitespace
@@ -792,11 +793,12 @@ private void collectTypeDeclarations(List<Mark> marks) {
792793
793794 // Resolve the main type
794795 ClassPathFinder .ClassInfo info = classPathFinder .resolveSimpleName (typeName , importedClasses );
795- TokenType tokenType = TokenType .TYPE_DECL ;
796+ TokenType tokenType = TokenType .UNDEFINED_VAR ;
796797 if (info != null ) {
797798 switch (info .type ) {
798799 case INTERFACE : tokenType = TokenType .INTERFACE_DECL ; break ;
799800 case ENUM : tokenType = TokenType .ENUM_DECL ; break ;
801+ default : tokenType = TokenType .TYPE_DECL ;
800802 }
801803 }
802804 marks .add (new Mark (typeNameStart , typeNameEnd , tokenType ));
You can’t perform that action at this time.
0 commit comments