mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 20:07:32 +00:00
Fixed parseLocalFields breaking with generics list List<String>
This commit is contained in:
1 parent
f3ba05068d
commit
aeda4f0f39
1 file changed
+2
-3
@@ -825,9 +825,8 @@ public class ScriptDocument {
|
||||
// Pattern for local variable declarations: Type varName = or Type varName;
|
||||
// Allows capital var names like "Minecraft Capital = new Minecraft();"
|
||||
// Use [ \t] instead of \s to prevent matching across newlines
|
||||
Pattern localDecl = Pattern.compile(
|
||||
"\\b([A-Za-z_][a-zA-Z0-9_<>\\[\\]]*)[ \\t]+([A-Za-z_][a-zA-Z0-9_]*)[ \\t]*(=|;|,)");
|
||||
Matcher m = localDecl.matcher(bodyText);
|
||||
|
||||
Matcher m = FIELD_DECL_PATTERN.matcher(bodyText);
|
||||
while (m.find()) {
|
||||
String typeName = m.group(1);
|
||||
String varName = m.group(2);
|
||||
|
||||
Reference in new issue
Block a user