From: Sven R. <rei...@ma...> - 2003-04-23 16:56:18
|
I looked into the white space problem when removing the first declarator in a declarator expression. The problem is that when rewriting, we don't have access to the removed element anymore. Maybe we can just mark things as removed, without replacing them by null pointers. Sven. -- Sven Reichard Dept. of Math. Sci. University of Delaware rei...@ma... |
From: Sven R. <rei...@ma...> - 2003-04-24 16:29:42
|
I solved the "space problem" that occured when rewriting declarator expression. I'm currently checking in the changes. My past remarks about keeping pointers to deleted elements are obsolete. Sorry about the confusion. Sven. -- Sven Reichard Dept. of Math. Sci. University of Delaware rei...@ma... |
From: Baptiste L. <gai...@fr...> - 2003-04-25 08:04:03
|
Good. I've added a test to SplitDeclarationRefactoringTest for declaration occuring inside for statement. What should we do in that case ? If we keep the current semantic of the refactoring, I think a error should be reported, but on the other hand, we could change the refactoring to ExtractDeclarationRefactoring. For a declaration statement, the semantic remaing identical. For a declaration occuring in a for statement (initializer), a if or a while condition, declarations are extracted before the for statement (tricky, may need to add a compound statement). What do you think ? Baptiste. ----- Original Message ----- From: "Sven Reichard" <rei...@ma...> To: "CppTool Mailing List" <Cpp...@li...> Sent: Thursday, April 24, 2003 6:29 PM Subject: [Cpptool-develop] space problem > I solved the "space problem" that occured when rewriting declarator > expression. I'm currently checking in the changes. > > My past remarks about keeping pointers to deleted elements are obsolete. > Sorry about the confusion. > > Sven. > > -- > Sven Reichard > Dept. of Math. Sci. > University of Delaware > rei...@ma... |
From: Sven R. <rei...@ma...> - 2003-04-25 13:42:51
|
On Fri, 25 Apr 2003, Baptiste Lepilleur wrote: > Good. > > I've added a test to SplitDeclarationRefactoringTest for declaration > occuring inside for statement. > > What should we do in that case ? If we keep the current semantic of the > refactoring, I think a error should be reported, but on the other hand, we > could change the refactoring to ExtractDeclarationRefactoring. For now, I think an error should be reported. > > For a declaration statement, the semantic remaing identical. > For a declaration occuring in a for statement (initializer), a if or a while > condition, declarations are extracted before the for statement (tricky, may > need to add a compound statement). > > What do you think ? This requires some more sophisticated code analysis, unless we decide to always encapsulate the extracted declaration and the for statement in a new compound. Let's keep this on the TODO list. Sven. > Baptiste. > > ----- Original Message ----- > From: "Sven Reichard" <rei...@ma...> > To: "CppTool Mailing List" <Cpp...@li...> > Sent: Thursday, April 24, 2003 6:29 PM > Subject: [Cpptool-develop] space problem > > > > I solved the "space problem" that occured when rewriting declarator > > expression. I'm currently checking in the changes. > > > > My past remarks about keeping pointers to deleted elements are obsolete. > > Sorry about the confusion. > > > > Sven. > > > > -- > > Sven Reichard > > Dept. of Math. Sci. > > University of Delaware > > rei...@ma... > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Cpptool-develop mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cpptool-develop > -- Sven Reichard Dept. of Math. Sci. University of Delaware rei...@ma... |
From: Baptiste L. <gai...@fr...> - 2003-04-26 22:30:38
|
Fine with me (doing the error detection is already part of the work). Though, we agree that it can be a useful refactoring ?. Notes that the code model make adding a compound fairly easy. The hard part is figuring out if it is needed, and what data to put in. Baptiste. ----- Original Message ----- From: "Sven Reichard" <rei...@ma...> To: "CppTool Mailing List" <Cpp...@li...> Sent: Friday, April 25, 2003 3:42 PM Subject: Re: [Cpptool-develop] space problem > On Fri, 25 Apr 2003, Baptiste Lepilleur wrote: > > > Good. > > > > I've added a test to SplitDeclarationRefactoringTest for declaration > > occuring inside for statement. > > > > What should we do in that case ? If we keep the current semantic of the > > refactoring, I think a error should be reported, but on the other hand, we > > could change the refactoring to ExtractDeclarationRefactoring. > > For now, I think an error should be reported. > > > > For a declaration statement, the semantic remaing identical. > > For a declaration occuring in a for statement (initializer), a if or a while > > condition, declarations are extracted before the for statement (tricky, may > > need to add a compound statement). > > > > What do you think ? > > This requires some more sophisticated code analysis, unless we decide to > always encapsulate the extracted declaration and the for statement in a > new compound. Let's keep this on the TODO list. > > Sven. > > > Baptiste. > > > > ----- Original Message ----- > > From: "Sven Reichard" <rei...@ma...> > > To: "CppTool Mailing List" <Cpp...@li...> > > Sent: Thursday, April 24, 2003 6:29 PM > > Subject: [Cpptool-develop] space problem > > > > > > > I solved the "space problem" that occured when rewriting declarator > > > expression. I'm currently checking in the changes. > > > > > > My past remarks about keeping pointers to deleted elements are obsolete. > > > Sorry about the confusion. > > > > > > Sven. > > > > > > -- > > > Sven Reichard > > > Dept. of Math. Sci. > > > University of Delaware > > > rei...@ma... |
From: Baptiste L. <gai...@fr...> - 2003-04-23 19:22:42
|
I'm not sure I understand what you want. The Change structure stored the original source range of the element is what was parsed (set in the setElementIsFromSource() method of CodeElement). That way the old text can be retrieved if needed, as well as its range for deletion. Problem with keeping the old pointer around is that a common practice of refactoring is to move things around (for example, remove a statement and insert it somewhere else). Baptiste. ----- Original Message ----- From: "Sven Reichard" <rei...@ma...> To: "CppTool Mailing List" <Cpp...@li...> Sent: Wednesday, April 23, 2003 6:56 PM Subject: [Cpptool-develop] space problem > I looked into the white space problem when removing the first declarator > in a declarator expression. The problem is that when rewriting, we don't > have access to the removed element anymore. Maybe we can just mark things > as removed, without replacing them by null pointers. > > Sven. > > -- > Sven Reichard > Dept. of Math. Sci. > University of Delaware > rei...@ma... |
From: Sven R. <rei...@ma...> - 2003-04-23 22:49:15
|
On Wed, 23 Apr 2003, Baptiste Lepilleur wrote: > I'm not sure I understand what you want. The Change structure stored the > original source range of the element is what was parsed (set in the > setElementIsFromSource() method of CodeElement). That way the old text can > be retrieved if needed, as well as its range for deletion. What I want is to avoid reparsing the source code. > > Problem with keeping the old pointer around is that a common practice of > refactoring is to move things around (for example, remove a statement and > insert it somewhere else). So what? That's why use smart pointers, isn't it? Maybe I'm again missing something major here :) Sven. > Baptiste. -- Sven Reichard Dept. of Math. Sci. University of Delaware rei...@ma... |