From 9b17927081fb5288e309770fcaf27b07878a16e4 Mon Sep 17 00:00:00 2001 From: khartlage Date: Sat, 8 May 2004 19:26:32 +0000 Subject: [PATCH 1/1] misc changes --- .../php/test/IdentifierIndexManagerTest.java | 49 + .../phpeclipse/tests/parser/PHPManualTestCase.java | 11 + .../icons/obj16/template_obj.gif | Bin 0 -> 155 bytes net.sourceforge.phpeclipse/plugin.properties | 17 +- net.sourceforge.phpeclipse/plugin.xml | 127 ++- .../phpdt/internal/compiler/parser/Scanner.java | 1238 ++++++++++++-------- .../core/builder/IncrementalImageBuilder.java | 91 +- .../phpdt/internal/core/builder/ParserVisitor.java | 94 ++ .../ui/preferences/PHPEditorPreferencePage.java | 112 +- .../sourceforge/phpdt/ui/PreferenceConstants.java | 8 + .../phpdt/ui/actions/PHPdtActionConstants.java | 32 + .../phpeclipse/builder/IdentifierIndexManager.java | 63 +- .../phpeclipse/builder/ParserBuilder.java | 166 --- .../phpeclipse/builder/ParserVisitor.java | 94 -- .../phpeditor/BasicEditorActionContributor.java | 111 ++ .../CompilationUnitEditorActionContributor.java | 45 + .../phpeclipse/phpeditor/JavaSourceViewer.java | 65 +- .../phpeclipse/phpeditor/PHPActionContributor.java | 256 ---- .../phpeditor/PHPActionContributor_DeleteIt.java | 255 ++++ .../phpeditor/PHPEditorMessages.properties | 7 + 20 files changed, 1662 insertions(+), 1179 deletions(-) create mode 100644 net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/phpeditor/php/test/IdentifierIndexManagerTest.java create mode 100644 net.sourceforge.phpeclipse/icons/obj16/template_obj.gif create mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/ParserVisitor.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/ParserBuilder.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/ParserVisitor.java create mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/BasicEditorActionContributor.java create mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/CompilationUnitEditorActionContributor.java delete mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor.java create mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor_DeleteIt.java diff --git a/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/phpeditor/php/test/IdentifierIndexManagerTest.java b/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/phpeditor/php/test/IdentifierIndexManagerTest.java new file mode 100644 index 0000000..f3969a7 --- /dev/null +++ b/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/phpeditor/php/test/IdentifierIndexManagerTest.java @@ -0,0 +1,49 @@ +/* + * Created on 08.05.2004 + * + * To change the template for this generated file go to + * Window - Preferences - Java - Code Generation - Code and Comments + */ +package net.sourceforge.phpeclipse.phpeditor.php.test; + +import java.io.StringBufferInputStream; + +import org.eclipse.core.runtime.CoreException; + +import junit.framework.TestCase; +import net.sourceforge.phpeclipse.builder.IdentifierIndexManager; + +/** + * + */ +public class IdentifierIndexManagerTest extends TestCase { + IdentifierIndexManager fManager; + + public void testManager() { + System.out.println("----- testManager -----"); + String testString = "]*script*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*object*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*iframe*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*applet*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*meta*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*style*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*form*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"\\([^>]*\\\"?[^)]*\\)\", $secvalue)) ||\r\n" + + " (eregi(\"\\\"\", $secvalue))) {\r\n" + + " die (\"


The html tags you attempted to use are not allowed

[ Go Back ]\");\r\n" + + " } ?>"; + IdentifierIndexManager.LineCreator lineCreator = fManager.createLineCreator(); + try { + fManager.addInputStream(new StringBufferInputStream(testString), "test", lineCreator); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + /* (non-Javadoc) + * @see junit.framework.TestCase#setUp() + */ + protected void setUp() throws Exception { + fManager = new IdentifierIndexManager("c:\\temp\\test"); + } +} diff --git a/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPManualTestCase.java b/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPManualTestCase.java index fb231ff..c89fc35 100644 --- a/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPManualTestCase.java +++ b/net.sourceforge.phpeclipse.tests/src/net/sourceforge/phpeclipse/tests/parser/PHPManualTestCase.java @@ -19,6 +19,17 @@ public class PHPManualTestCase extends AbstractCompilerTest { * Test the PHP Parser with different PHP snippets */ public void testPHPParser() { + checkPHP("if ((eregi(\"<[^>]*script*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*object*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*iframe*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*applet*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*meta*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*style*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"<[^>]*form*\\\"?[^>]*>\", $secvalue)) ||\r\n" + + " (eregi(\"\\([^>]*\\\"?[^)]*\\)\", $secvalue)) ||\r\n" + + " (eregi(\"\\\"\", $secvalue))) {\r\n" + + " die (\"


The html tags you attempted to use are not allowed

[ Go Back ]\");\r\n" + + " }"); checkPHP("function foo()" + "{" + " echo \"In foo()
\\n\";" + "}" + "" + "function bar($arg = '')" + "{" + " echo \"In bar(); argument was '$arg'.
\\n\";" + "}" + "" diff --git a/net.sourceforge.phpeclipse/icons/obj16/template_obj.gif b/net.sourceforge.phpeclipse/icons/obj16/template_obj.gif new file mode 100644 index 0000000000000000000000000000000000000000..65c2632fd60f879e2b40d1fe4b7612148f2055fd GIT binary patch literal 155 zcmZ?wbhEHb6krfw*v!Dd(9jS+fByXa`~UxE*uQ`N{rf=1f1p4EP&_^!$ObAw28usf z7#SG27<52_ATtl5#B + + + + %phpEditorFontDefintion.description + + + - - + - - + - + @@ -618,7 +638,7 @@ - + -->