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 96391 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]
patch to handle nested functions
patch.txt (text/plain), 2.80 KB, created by
Etienne Pfister
on 2008-04-17 04:18:22 EDT
(
hide
)
Description:
patch to handle nested functions
Filename:
MIME Type:
Creator:
Etienne Pfister
Created:
2008-04-17 04:18:22 EDT
Size:
2.80 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.9 >diff -u -r1.9 NaiveASTFlattener.java >--- NaiveASTFlattener.java 30 Jan 2008 18:10:19 -0000 1.9 >+++ NaiveASTFlattener.java 17 Apr 2008 07:51:21 -0000 >@@ -281,8 +281,10 @@ > public boolean visit(Block node) { > 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.8 >diff -u -r1.8 ASTNode.java >--- ASTNode.java 8 Feb 2008 20:02:11 -0000 1.8 >+++ ASTNode.java 17 Apr 2008 07:51:20 -0000 >@@ -1898,7 +1898,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.MethodDeclaration)) { >+ 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.16 >diff -u -r1.16 ASTConverter.java >--- ASTConverter.java 26 Mar 2008 20:57:07 -0000 1.16 >+++ ASTConverter.java 17 Apr 2008 07:51:20 -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
Actions:
View
|
Diff
Attachments on
bug 227489
:
96388
|
96391
|
98875