Skip to content

Commit b073b55

Browse files
davidpichardiefacebook-github-bot
authored andcommitted
Fixing warning in experimental Java source parser
Summary: Removing some dead grammar rules Reviewed By: jvillard Differential Revision: D25087155 fbshipit-source-id: 66146cf47
1 parent 606a3c9 commit b073b55

File tree

2 files changed

+14
-36
lines changed

2 files changed

+14
-36
lines changed

infer/src/java/jSourceLexer.mll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ rule class_scan = parse
9191
{ VAR }
9292
| "extends"
9393
{ EXTENDS }
94-
| "super"
95-
{ SUPER }
9694
| "implements"
9795
{ IMPLEMENTS }
9896
| "assert"

infer/src/java/jSourceParser.mly

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
%token INTERFACE
2121
%token IMPLEMENTS
2222
%token EXTENDS
23-
%token SUPER
2423
%token ENUM
2524
%token NEW
2625
%token INSTANCEOF
@@ -108,25 +107,6 @@ import_name_end:
108107
| DOT IDENT import_name_end
109108
{}
110109

111-
type_arguments:
112-
| LANGLE type_argument_list RANGLE
113-
{}
114-
115-
type_argument_list:
116-
| separated_nonempty_list(COMMA, type_argument)
117-
{}
118-
119-
type_argument:
120-
| unann_reference_type // If we decide to parse annotations, it will
121-
// require change here
122-
| QMARK wildcard_bounds?
123-
{}
124-
125-
wildcard_bounds:
126-
| EXTENDS unann_reference_type
127-
| SUPER unann_reference_type
128-
{}
129-
130110
package_declaration:
131111
| PACKAGE unann_class_or_interface_type SEMICOLON
132112
{ $2 }
@@ -146,18 +126,18 @@ class_declaration:
146126
normal_class_declaration:
147127
| CLASS id=identifier superclass? superinterfaces? inner=class_body
148128
{ {
149-
location = location_of_pos $startpos(id);
150-
kind = Class id;
151-
inner_elements = inner;
129+
location = location_of_pos $startpos(id);
130+
kind = Class id;
131+
inner_elements = inner;
152132
}
153133
}
154134

155135
enum_declaration:
156136
| ENUM id=identifier superinterfaces? inner=enum_body
157137
{ {
158-
location = location_of_pos $startpos(id);
159-
kind = Enum id;
160-
inner_elements = inner;
138+
location = location_of_pos $startpos(id);
139+
kind = Enum id;
140+
inner_elements = inner;
161141
}
162142
}
163143

@@ -235,9 +215,9 @@ interface_declaration:
235215
normal_interface_declaration:
236216
| INTERFACE id=identifier inner=interface_body
237217
{ {
238-
location = location_of_pos $startpos(id);
239-
kind = Interface id;
240-
inner_elements = inner;
218+
location = location_of_pos $startpos(id);
219+
kind = Interface id;
220+
inner_elements = inner;
241221
}
242222
}
243223

@@ -697,11 +677,11 @@ unqualified_class_instance_creation_expression:
697677
{ $4 }
698678
| NEW class_or_interface_type_to_instantiate LPAREN args=loption(argument_list) RPAREN inner=class_body
699679
{ args @
700-
[{
701-
location = location_of_pos $startpos(inner);
702-
kind = AnonymousClass;
703-
inner_elements = inner;
704-
}]
680+
[{
681+
location = location_of_pos $startpos(inner);
682+
kind = AnonymousClass;
683+
inner_elements = inner;
684+
}]
705685
}
706686

707687
conditional_expression:

0 commit comments

Comments
 (0)