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

JavaScript target cannot use rule exceptions #1741

Closed
ChristophWedler opened this issue Mar 9, 2017 · 3 comments
Closed

JavaScript target cannot use rule exceptions #1741

ChristophWedler opened this issue Mar 9, 2017 · 3 comments

Comments

@ChristophWedler
Copy link

The try block around the rule body is not properly closed by } when using rule exceptions:

grammar noRuleExceptions;
options { language = JavaScript; }

start
    :
        'start'
    ;
    catch [re] {
        throw re;
    }

In antlr4/tool/resources/org/antlr/v4/tool/templates/codegen/JavaScript/JavaScript.stg,
the } must move from after to before the following block (starting in line 269),
as it is done for the Java target:

    <if(exceptions)>
    <exceptions; separator="\n">
    <else>
@ericvergnaud
Copy link
Contributor

ericvergnaud commented Mar 10, 2017 via email

@ChristophWedler
Copy link
Author

I have understood that I also need to sign contributors.txt - still need some days to get an official OK from the company I work at.

@ericvergnaud
Copy link
Contributor

Closing as already fixed

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

No branches or pull requests

2 participants