c2nes / javalang

Pure Python Java parser and tools
MIT License
737 stars 161 forks source link

private List<@Length(min = 0, max = NumberKeys.NUM_128) String> member java code like this will be analysed wrong #81

Open wangyun2018 opened 4 years ago

wangyun2018 commented 4 years ago

private List<@Length(min = 0, max = NumberKeys.NUM_128) String> campAlias解析报错

cloudyfly commented 4 years ago

there is the same error happened in my code

cloudyfly commented 4 years ago
tree = javalang.parse.parse(file_cont)

File "D:\javalang\lib\javalang\parse.py", line 53, in parse return parser.parse() File "D:\javalang\lib\javalang\parser.py", line 110, in parse return self.parse_compilation_unit() File "D:\javalang\lib\javalang\parser.py", line 302, in parse_compilation_unit type_declaration = self.parse_type_declaration() File "D:\javalang\lib\javalang\parser.py", line 347, in parse_type_declaration return self.parse_class_or_interface_declaration() File "D:\javalang\lib\javalang\parser.py", line 356, in parse_class_or_interface_declaration type_declaration = self.parse_normal_class_declaration() File "D:\javalang\lib\javalang\parser.py", line 394, in parse_normal_class_declaration body = self.parse_class_body() File "D:\javalang\lib\javalang\parser.py", line 768, in parse_class_body declaration = self.parse_class_body_declaration() File "D:\javalang\lib\javalang\parser.py", line 791, in parse_class_body_declaration return self.parse_member_declaration() File "D:\javalang\lib\javalang\parser.py", line 825, in parse_member_declaration member = self.parse_method_or_field_declaraction() File "D:\javalang\lib\javalang\parser.py", line 836, in parse_method_or_field_declaraction member_type = self.parse_type() File "D:\javalang\lib\javalang\parser.py", line 466, in parse_type java_type = self.parse_reference_type() File "D:\javalang\lib\javalang\parser.py", line 487, in parse_reference_type tail.arguments = self.parse_type_arguments() File "D:\javalang\lib\javalang\parser.py", line 504, in parse_type_arguments type_argument = self.parse_type_argument() File "D:\javalang\lib\javalang\parser.py", line 530, in parse_type_argument base_type = self.parse_reference_type() File "D:\javalang\lib\javalang\parser.py", line 484, in parse_reference_type tail.name = self.parse_identifier() File "D:\javalang\lib\javalang\parser.py", line 232, in parse_identifier return self.accept(Identifier) File "D:\javalang\lib\javalang\parser.py", line 133, in accept self.illegal("Expected %s" % (accept.name,)) File "D:\javalang\lib\javalang\parser.py", line 119, in illegal raise JavaSyntaxError(description, at) lib.javalang.parser.JavaSyntaxError

lyriccoder commented 4 years ago

I believe such the syntax is not supported by this version of the framework. So, if you want, you can implement it.