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

Functions are in some cases incorrectly scoped as objects #35

Open
eirik-kjonstad opened this issue Jan 26, 2021 · 1 comment
Open

Functions are in some cases incorrectly scoped as objects #35

eirik-kjonstad opened this issue Jan 26, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@eirik-kjonstad
Copy link
Owner

eirik-kjonstad commented Jan 26, 2021

I've noticed that the syntax will sometimes incorrectly scope expressions involving functions and object-accessing. Here is an example:

result = foo(object%member)    ! foo scoped as variable.function
result = foo(object(k)%member) ! foo scoped as storage.type.class

The reason for the wrong scope is the following:

    - match: '(\w+)\s*(?=\%|\[.*\]\(.*\)\%|\(.*\)\%|\[.*\]\%)'
      scope: storage.type.class.fortran

It assumes that the ) in object(k) is the closing parenthesis of foo and so misinterprets foo as an storage.type.class.

@eirik-kjonstad eirik-kjonstad added the bug Something isn't working label Jan 26, 2021
@eirik-kjonstad
Copy link
Owner Author

This issue is partly resolved in #44 and release 1.2.0.

I will leave the issue open because there are still cases where expressions are misinterpreted because the syntax is not able to "match" parentheses when interpreting the expression, e.g.

result = foo(object(k)%otherObject(myFoo(k))%member)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant