-
Notifications
You must be signed in to change notification settings - Fork 56
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
wrong parsing of return statement #17
Comments
I think that the problem here is that the parser think that a return statement with a call_expression is a infix_expression, but a infix expression can not have more than 1 parameter. If we parse the following code class Class {
fun method() {
return listOf(
A()
)
}
} The S-expression will become
|
This has been fixed. (source_file [0, 0] - [10, 0]
(class_declaration [0, 0] - [9, 1]
(type_identifier [0, 6] - [0, 11])
(class_body [0, 12] - [9, 1]
(function_declaration [2, 4] - [7, 5]
(simple_identifier [2, 8] - [2, 14])
(function_value_parameters [2, 14] - [2, 16])
(function_body [2, 17] - [7, 5]
(statements [3, 8] - [6, 9]
(jump_expression [3, 8] - [6, 9]
(call_expression [3, 15] - [6, 9]
(simple_identifier [3, 15] - [3, 21])
(call_suffix [3, 21] - [6, 9]
(value_arguments [3, 21] - [6, 9]
(value_argument [4, 12] - [4, 15]
(call_expression [4, 12] - [4, 15]
(simple_identifier [4, 12] - [4, 13])
(call_suffix [4, 13] - [4, 15]
(value_arguments [4, 13] - [4, 15]))))
(value_argument [5, 12] - [5, 15]
(call_expression [5, 12] - [5, 15]
(simple_identifier [5, 12] - [5, 13])
(call_suffix [5, 13] - [5, 15]
(value_arguments [5, 13] - [5, 15])))))))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the following code
during parsing becomes
Similar list initialization e.g. for a local variable works fine.
The text was updated successfully, but these errors were encountered: