MCPcopy Create free account
hub / github.com/FabricMC/Matcher / parse

Method parse

src/main/java/matcher/type/Signature.java:12–41  ·  view source on GitHub ↗
(String sig, ClassEnv env)

Source from the content-addressed store, hash-verified

10public final class Signature {
11 public static final class ClassSignature implements PotentialComparable<ClassSignature> {
12 public static ClassSignature parse(String sig, ClassEnv env) {
13 // [<TypeParameter+>] ClassTypeSignature ClassTypeSignature*
14 ClassSignature ret = new ClassSignature();
15 MutableInt pos = new MutableInt();
16
17 if (sig.startsWith("<")) {
18 pos.val++;
19 ret.typeParameters = new ArrayList<>();
20
21 do {
22 ret.typeParameters.add(TypeParameter.parse(sig, pos, env));
23 } while (sig.charAt(pos.val) != '>');
24
25 pos.val++;
26 }
27
28 ret.superClassSignature = ClassTypeSignature.parse(sig, pos, env);
29
30 if (pos.val < sig.length()) {
31 ret.superInterfaceSignatures = new ArrayList<>();
32
33 do {
34 ret.superInterfaceSignatures.add(ClassTypeSignature.parse(sig, pos, env));
35 } while (pos.val < sig.length());
36 }
37
38 assert ret.toString().equals(sig);
39
40 return ret;
41 }
42
43 public String toString(NameType nameType) {
44 StringBuilder ret = new StringBuilder();

Callers 4

processClassAMethod · 0.95
getEntriesMethod · 0.45
decorateMethod · 0.45

Calls 4

parseMethod · 0.95
parseMethod · 0.95
toStringMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected