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

Braceless anonymous function scopes are not always closed #19

Open
Gama11 opened this issue Mar 2, 2017 · 2 comments
Open

Braceless anonymous function scopes are not always closed #19

Gama11 opened this issue Mar 2, 2017 · 2 comments
Labels

Comments

@Gama11
Copy link
Member

Gama11 commented Mar 2, 2017

The grammar relies on a ; to close function scopes when there are no braces. However, for instance inside of function arguments, like in the following example, it doesn't ever get to match against the ;:

class C {
    function f() {
        f(
            function() f,
            function() f,
            function() f
        );
    }
}

As a result, there are too many function scopes on the stack that won't ever be closed:

This causes subsequent highlighting to break in some cases, for instance the type name T here:

@Gama11 Gama11 added the bug label Mar 2, 2017
@Gama11 Gama11 changed the title Braceless anonymous functions scopes are not closed Braceless anonymous function scopes are not always closed Mar 2, 2017
@nadako
Copy link
Member

nadako commented Apr 5, 2017

Check if fixing this also fixes #23 :)

@back2dos
Copy link

Hmm. It looks to me like arrow functions cause no such issues. Could their syntax definition be used as a basis for anonymous functions?

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

No branches or pull requests

3 participants