Great works Andrea. I guess finding that bug must have been educative. I
have stumbled uppon it a few time myself. With this, support for the
RenameLocaleVariable refactoring is getting real good!!!
To deal with the for scope variability, we should indeed make it
configurable. Though, it should be project dependent, not compiler dependent
(you can compile a given project on multiple compiler/platform).
According to the page below (which explains the issue very well), on VC7 the
standard conformant behavior can be activated.
http://msdn.microsoft.com/library/en-us/vclang/html/_pluslang_The_C.2b2b_.fo
r_Statement.asp?frame=true
Baptiste.
----- Original Message -----
From: "Andre Baresel" <and...@gm...>
To: "CppTool Mailing List" <Cpp...@li...>
Sent: Thursday, December 19, 2002 9:09 PM
Subject: [Cpptool-develop] Parsing the for-iteration-expression works, all
tests successful !
> I have just found the bug which causes the failing of the "testForScope"
> working with my parser extensions.
>
> It was a wrong property of the 'forIterationExpression'
>
> const ASTNodeType
STNodeTypes::forIterationExpression( "for-iteration-expression",
> hasScope |
> mayHaveVariableDeclProperties |
> mayHaveLocalScopeIdentifierChildren |
> mayHaveScopeGeneratorProperties );
>
> where
> "mayHaveLocalScopeIdentifierChildren" is really
"mayHaveLocalScopeIdentifierProperties"
>
> since all elements of the forIterationExpressions are Properties.
>
> to see this bug optimistical - it helped me to get into the way how
identier resolving is
> done ;-)
>
> btw) is there any idea how to solve this problem of VC6 ? since the vc6
does not open an extra scope
> for the "for-statement" and keeps it simply like a declaration within the
scope of the for-statement.
> e.g.
> int i;
> for (int i; ....
> --> will lead to a compiler error "redefinition of 'i'", whereas this
works in "stdc++"
>
> Should we add some configuration settings, so that for this case the scope
creation will depend
> on compiler settings ?
>
> Ok, I'm ready to check in my changes,
> message me if i can.
>
> -- André
|