Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 98875 Details for
Bug 227489
AST does not support nested functions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
new patch to handle nested functions
patch.txt (text/plain), 2.76 KB, created by
Etienne Pfister
on 2008-05-06 12:09:02 EDT
(
hide
)
Description:
new patch to handle nested functions
Filename:
MIME Type:
Creator:
Etienne Pfister
Created:
2008-05-06 12:09:02 EDT
Size:
2.76 KB
patch
obsolete
>Index: NaiveASTFlattener.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/NaiveASTFlattener.java,v >retrieving revision 1.11 >diff -u -r1.11 NaiveASTFlattener.java >--- NaiveASTFlattener.java 30 Apr 2008 21:32:15 -0000 1.11 >+++ NaiveASTFlattener.java 6 May 2008 15:16:01 -0000 >@@ -285,7 +285,8 @@ > this.buffer.append("{\n");//$NON-NLS-1$ > this.indent++; > for (Iterator it = node.statements().iterator(); it.hasNext(); ) { >- Statement s = (Statement) it.next(); >+ // fix for inner function handling, Etienne Pfister >+ ASTNode s = (ASTNode) it.next(); > s.accept(this); > } > this.indent--; >Index: ASTNode.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTNode.java,v >retrieving revision 1.10 >diff -u -r1.10 ASTNode.java >--- ASTNode.java 30 Apr 2008 21:32:16 -0000 1.10 >+++ ASTNode.java 6 May 2008 15:16:00 -0000 >@@ -1902,7 +1902,11 @@ > Class childClass = newChild.getClass(); > if (nodeType != null && !nodeType.isAssignableFrom(childClass)) { > // new child is not of the right type >- throw new ClassCastException(); >+ >+ // fix for inner function handling, Etienne Pfister >+ if(!(newChild instanceof org.eclipse.wst.jsdt.core.dom.FunctionDeclaration)) { >+ throw new ClassCastException(); >+ } > } > if ((newChild.typeAndFlags & PROTECT) != 0) { > // new child node is protected => cannot be parented >Index: ASTConverter.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/ASTConverter.java,v >retrieving revision 1.18 >diff -u -r1.18 ASTConverter.java >--- ASTConverter.java 30 Apr 2008 21:32:15 -0000 1.18 >+++ ASTConverter.java 6 May 2008 15:16:00 -0000 >@@ -518,7 +518,11 @@ > for (int i = 0; i < statementsLength; i++) { > if (statements[i] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration) { > checkAndAddMultipleLocalDeclaration(statements, i, block.statements()); >- } else { >+ } else if (statements[i] instanceof org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration) { // fix for inner function handling, Etienne Pfister >+ org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration method = (org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration) statements[i]; >+ block.statements().add(convert(method)); >+ } >+ else { > final Statement statement = convert(statements[i]); > if (statement != null) { > block.statements().add(statement);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 227489
:
96388
|
96391
| 98875