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

Already on GitHub? Sign in to your account

Curly braces inside actions of lex file #133

Closed
danyaPostfactum opened this Issue Jan 26, 2013 · 4 comments

Comments

Projects
None yet
2 participants

I have such lex rule:

<ST_IN_SCRIPTING>"}" {
    //RESET_DOC_COMMENT();
    this.popState();
    return "}";
}

this breaks jison generator builder.

I hope it's easy to fix.
My temporary workaround is return String.fromCharCode(125);

Thanks

Owner

zaach commented Jan 28, 2013

Try %{ %} braces:

<ST_IN_SCRIPTING>"}" %{
    //RESET_DOC_COMMENT();
    this.popState();
    return "}";
%}

Thanks, I think it should work. Looks like jison parser needs balanced braces :) . Interesting, how does original lex parser avoids confusing while parsing. But I can't still continue my work due to #134

I'm working on lex file for php language.

Owner

zaach commented Jan 29, 2013

Yep, we can probably look out for braces in strings to fix the balancing issue. I'll close this for now since it seems your original issue has been resolved.

@zaach zaach closed this Jan 29, 2013

I just added commented extra braces )

<ST_IN_SCRIPTING>"}" %{
    //RESET_DOC_COMMENT();
    this.popState();// {
    return "}";
%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment