Review Request 104798: kjs: Fix shift/reduce issues in grammar.y + cleanup

Bernd Buschinski b.buschinski at googlemail.com
Tue Jan 22 03:11:53 GMT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104798/
-----------------------------------------------------------

(Updated Jan. 22, 2013, 3:11 a.m.)


Review request for kdelibs.


Changes
-------

re-generate with bison 2.7


Description
-------

kjs: Fix shift/reduce issues in grammar.y + cleanup

The IterationStatement caused 1 shift/reduce conflict.
This is because of those 2 lines

DO Statement WHILE '(' Expr ')' ';' { $$ = new DoWhileNode($2, $5); DBG($$, @1, @3);}
DO Statement WHILE '(' Expr ')' { $$ = new DoWhileNode($2, $5); DBG($$, @1, @3); }

they only differ in ';', which bison/grammar.y has as default. So these 2 lines are basically the same
for bison, and it does not know know which one to pick. The Solution is easy, just removing
the ';' line will fix it.


The other changes fix bison warnings like

grammar.y:257.67: warning: a `;' might be needed at the end of action code
grammar.y:257.67: warning: future versions of Bison will not add the `;'

adding a simple ; is a simple fix and doesn't hurt


Diffs (updated)
-----

  kjs/grammar.cpp 71245a4 
  kjs/grammar.y d5e835f 

Diff: http://git.reviewboard.kde.org/r/104798/diff/


Testing
-------

run ecmascript with and without this patch, same result, so it shouldn't introduce a regression.


Thanks,

Bernd Buschinski

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20130122/2aa3a0ba/attachment.htm>


More information about the kde-core-devel mailing list