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

startConditions error #9

Open
ichiriac opened this issue Jul 27, 2014 · 0 comments
Open

startConditions error #9

ichiriac opened this issue Jul 27, 2014 · 0 comments

Comments

@ichiriac
Copy link

I'm using latest jison version for generating a parser and i've got this error :

...\node_modules\jison\node_modules\jison-lex\regexp-lexer.js:44
                  startConditions[conditions[k]].rules.push(i);
                                                ^
TypeError: Cannot read property 'rules' of undefined
    at prepareRules (...\node_modules\jison\node_modules\jison-lex\regexp-lexer.js:44:49)
    at Object.buildActions (...\node_modules\jison\node_modules\jison-lex\regexp-lexer.js:115:18)
    at Object.RegExpLexer (...\node_modules\jison\node_modules\jison-lex\regexp-lexer.js:141:39)
    at Jison_Generator (...\node_modules\jison\lib\jison.js:111:22)
    at (anonymous function) (...\node_modules\jison\lib\util\typal.js:23:28)
    at new o.constructor (...\node_modules\jison\lib\util\typal.js:77:70)
    at Object.Jison_Generator [as Generator] (...\node_modules\jison\lib\jison.js:1740:20)
    at new Parser (...\node_modules\jison\lib\jison.js:1745:25)

To reproduce this issue you can use this syntax file :

/* BUG : TypeError: Cannot read property 'rules' of undefined */

%lex

%x INITIAL

%%

<INITIAL>"{" %{
  this.begin('BRACKET');
  console.log('{');
%}
<BRACKET>"}" %{
  this.popState();
  console.log('}');
%}

/lex

%start start

%%

start: [^];

I've tried to change regexp-lexer.js line 43 with the following, but I'm not sure :

  if (startConditions.hasOwnProperty(conditions[k])) {
    startConditions[conditions[k]].rules.push(i);
  }
GerHobbelt added a commit to GerHobbelt/jison-lex that referenced this issue Sep 2, 2014
…d start conditions error zaach#9; assume %x for missing start condition declarations.

Conflicts:
	regexp-lexer.js
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

1 participant