|
@@ -62,24 +62,36 @@ public class ParsedFile {
|
62
|
62
|
while (true) {
|
63
|
63
|
CodePosition position = tokens.peek().position;
|
64
|
64
|
int modifiers = 0;
|
65
|
|
- while (true) {
|
66
|
|
- if (tokens.optional(K_PUBLIC) != null) {
|
67
|
|
- modifiers |= Modifiers.PUBLIC;
|
68
|
|
- } else if (tokens.optional(K_PRIVATE) != null) {
|
69
|
|
- modifiers |= Modifiers.PRIVATE;
|
70
|
|
- } else if (tokens.optional(K_EXPORT) != null) {
|
71
|
|
- modifiers |= Modifiers.EXPORT;
|
72
|
|
- } else if (tokens.optional(K_ABSTRACT) != null) {
|
73
|
|
- modifiers |= Modifiers.ABSTRACT;
|
74
|
|
- } else if (tokens.optional(K_FINAL) != null) {
|
75
|
|
- modifiers |= Modifiers.FINAL;
|
76
|
|
- } else if (tokens.optional(K_PROTECTED) != null) {
|
77
|
|
- modifiers |= Modifiers.PROTECTED;
|
78
|
|
- } else if (tokens.optional(K_IMPLICIT) != null) {
|
79
|
|
- modifiers |= Modifiers.IMPLICIT;
|
80
|
|
- } else {
|
81
|
|
- break;
|
|
65
|
+ outer: while (true) {
|
|
66
|
+ switch (tokens.peek().type) {
|
|
67
|
+ case K_PUBLIC:
|
|
68
|
+ modifiers |= Modifiers.PUBLIC;
|
|
69
|
+ break;
|
|
70
|
+ case K_PRIVATE:
|
|
71
|
+ modifiers |= Modifiers.PRIVATE;
|
|
72
|
+ break;
|
|
73
|
+ case K_EXPORT:
|
|
74
|
+ modifiers |= Modifiers.EXPORT;
|
|
75
|
+ break;
|
|
76
|
+ case K_ABSTRACT:
|
|
77
|
+ modifiers |= Modifiers.ABSTRACT;
|
|
78
|
+ break;
|
|
79
|
+ case K_FINAL:
|
|
80
|
+ modifiers |= Modifiers.FINAL;
|
|
81
|
+ break;
|
|
82
|
+ case K_PROTECTED:
|
|
83
|
+ modifiers |= Modifiers.PROTECTED;
|
|
84
|
+ break;
|
|
85
|
+ case K_IMPLICIT:
|
|
86
|
+ modifiers |= Modifiers.IMPLICIT;
|
|
87
|
+ break;
|
|
88
|
+ case K_VIRTUAL:
|
|
89
|
+ modifiers |= Modifiers.VIRTUAL;
|
|
90
|
+ break;
|
|
91
|
+ default:
|
|
92
|
+ break outer;
|
82
|
93
|
}
|
|
94
|
+ tokens.next();
|
83
|
95
|
}
|
84
|
96
|
|
85
|
97
|
if (tokens.optional(K_IMPORT) != null) {
|