File tree Expand file tree Collapse file tree 2 files changed +15
-16
lines changed
Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 11start : compilation_unit
22
3- %import common .CNAME
4- %import common .DIGIT
5- %import common .WS
6-
7- %ignore WS
8-
9- LINE_COMMENT : / \/\/ [^ \n\r ]* /
10- BLOCK_COMMENT : / \/\* [\s\S ]*? \*\/ /
11-
123type_parameters : " <" type_parameter (" ," type_parameter )* " >"
134type_parameter : CNAME type_bound ?
145type_bound : " extends" type (" &" type )*
156
16- %ignore LINE_COMMENT
17- %ignore BLOCK_COMMENT
18-
197compilation_unit : package_declaration ? import_declarations ? type_declarations ?
208
219package_declaration : " package" name " ;"
@@ -188,7 +176,7 @@ floating_point_literal: DIGIT+ "." DIGIT+
188176
189177boolean_literal : " true" | " false"
190178
191- character_literal : " ' " / [ ^ \\ ' \n\r ] / " ' "
179+ character_literal : / ' ( [ ^ ' \r\n\\ ] | \\ ( [ btnfr"' \\ 0-7 ] | [ 0-3 ] ? [ 0-7 ] {2} ) | \\ u[ 0-9a-fA-f ] {4} ) ' /
192180
193181string_literal : / ". *? "/
194182
@@ -206,8 +194,6 @@ dim_expr: "[" expression "]"
206194
207195dims : " [" " ]" +
208196
209-
210-
211197field_access : primary " ." CNAME | " super" " ." CNAME
212198
213199method_invocation : name " (" argument_list ? " )" | primary " ." CNAME " (" argument_list ? " )" | " super" " ." CNAME " (" argument_list ? " )"
@@ -289,3 +275,12 @@ reference_type: class_or_interface_type | array_type
289275
290276array_type : primitive_type dims | name dims | array_type dims
291277
278+ LINE_COMMENT : / \/\/ [^ \n\r ]* /
279+ BLOCK_COMMENT : / \/\* [\s\S ]*? \*\/ /
280+
281+ %import common .CNAME
282+ %import common .DIGIT
283+ %import common .WS
284+ %ignore WS
285+ %ignore LINE_COMMENT
286+ %ignore BLOCK_COMMENT
Original file line number Diff line number Diff line change @@ -388,4 +388,8 @@ def test_java_parser26(self):
388388public """
389389 r = inc_parser .get_acceptable_next_terminals (partial_code )
390390 assert AcceptSequence (['CLASS' ]) in r .accept_sequences
391- assert r .remainder_state == RemainderState .COMPLETE
391+ assert r .remainder_state == RemainderState .COMPLETE
392+
393+ if __name__ == '__main__' :
394+ unittest .main ()
395+
You can’t perform that action at this time.
0 commit comments