thoni56 / c-xrefactory

A refactoring tool for C/Yacc and Emacs. The first tool to cross Refactory Rubicon. Initial work, and released under GPL in 2009, by Marián Vittek.
https://thoni56.github.io/c-xrefactory/
GNU General Public License v2.0
23 stars 4 forks source link

Handle modern for-construct with local loop variable #59

Closed thoni56 closed 3 years ago

thoni56 commented 4 years ago

The follwing causes a syntax error

for (int i = 0; ...

This implies that a user defined type would not get registered here:

for (Vptr p = ... ;

So we need to augment the C/Yacc grammars with support for

| FOR '(' declaration expression_statement ')' statement
| FOR '(' declaration expression_statement expression ')' statement
thoni56 commented 3 years ago

Fixed in 0303041a.