Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Java 8 support #18

Merged
merged 34 commits into from
Jun 5, 2015
Merged

Initial Java 8 support #18

merged 34 commits into from
Jun 5, 2015

Conversation

dbaxa
Copy link
Contributor

@dbaxa dbaxa commented Mar 10, 2015

adds support for lambda expressions and method/constructor references.

Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
@dbaxa
Copy link
Contributor Author

dbaxa commented Mar 10, 2015

cc @c2nes

class Annotation(JavaToken):
pass

class Identifier(JavaToken):
pass

class LambdaSymbol(JavaToken):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is unused and could be removed.

Signed-off-by: david black <dblack@atlassian.com>
Signed-off-by: david black <dblack@atlassian.com>
Signed-off-by: david black <dblack@atlassian.com>
Signed-off-by: david black <dblack@atlassian.com>
an Operator.

Signed-off-by: david black <dblack@atlassian.com>
Signed-off-by: david black <dblack@atlassian.com>
Signed-off-by: david black <dblack@atlassian.com>
… rename ExpressionWithMemberReference to MethodReference and add 'type_arguments' to it.

Signed-off-by: David Black <dblack@atlassian.com>
dbaxa added 15 commits May 5, 2015 11:25
…rt that the parse resource contains a lambda where we expect it to do so.

Signed-off-by: David Black <dblack@atlassian.com>
… assert_contains_lambda_expression_in_m.

Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
…into a new filter_type_in_method method.

Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
… to the method reference tests.

Signed-off-by: David Black <dblack@atlassian.com>
…ere parse_lambda_expression is called inside of parse_expression_3.

Signed-off-by: David Black <dblack@atlassian.com>
…') to accept('->').

Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
…ase.

Signed-off-by: David Black <dblack@atlassian.com>
…t pass.

Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
…s_for_generic_type.

Signed-off-by: David Black <dblack@atlassian.com>
@dbaxa
Copy link
Contributor Author

dbaxa commented May 5, 2015

@c2nes can we merge this code with the MethodReference limitations (see #18 (comment)) ?

dbaxa added 2 commits May 5, 2015 15:09
…da code changes.

Signed-off-by: David Black <dblack@atlassian.com>
Signed-off-by: David Black <dblack@atlassian.com>
c2nes added a commit that referenced this pull request Jun 5, 2015
@c2nes c2nes merged commit 4bf3be0 into c2nes:master Jun 5, 2015
@c2nes
Copy link
Owner

c2nes commented Jun 5, 2015

Sorry for the long delay @dbaxa. Thank you very much for the contribution!

@dbaxa
Copy link
Contributor Author

dbaxa commented Jun 9, 2015

Thank you for merging this :-)

@manoelcampos
Copy link

The javalang 0.10.1 parses default and static interface's methods of Java 8 but there is some issue with the version available via pip. Using pip 9.0.1 it downloads javalang 0.10.1 as shown below:

pip show javalang 
Name: javalang
Version: 0.10.1

However, it is raising exceptions when an interface has default or static methods.
The version installed by pip is different from the one available at GitHub, as the diff from file parser.py shows:

1051a1052
>         body = None
1056c1057,1060
<         self.accept(';')
---
>         if self.would_accept('{'):
>             body = self.parse_block()
>         else:
>             self.accept(';')
1059a1064
>                                       body=body,
1065a1071
>         body = None
1070c1076,1079
<         self.accept(';')
---
>         if self.would_accept('{'):
>             body = self.parse_block()
>         else:
>             self.accept(';')
1073c1082,1083
<                                       throws=throws)
---
>                                       throws=throws,
>                                       body=body)

@dbaxa
Copy link
Contributor Author

dbaxa commented Jan 9, 2017

cc @c2nes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants