Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java22
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex22
2 files changed, 40 insertions, 4 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
index 6a3abb9f25..1e9dc89762 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
@@ -1346,6 +1346,9 @@ public class JSPTokenizer implements BlockTokenizer, DOMJSPRegionContexts {
fCurrentTagName = newTagName;
}
+ private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
+ return doScan(searchString, requireTailSeparator, allowJSP, allowCDATA, false, searchContext, exitState, immediateFallbackState);
+ }
/**
* Method doScan.
*
@@ -1355,13 +1358,14 @@ public class JSPTokenizer implements BlockTokenizer, DOMJSPRegionContexts {
* @param searchString - target string to search for ex.: "-->", "</tagname"
* @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
* @param allowJSP - check for and allow for JSP markup <%%>
+ * @param allowTag - check for and allow for xml tags <
* @param context - the context of the scanned region if non-zero length
* @param exitState - the state to go to if the region was of non-zero length
* @param abortState - the state to go to if the searchString was found immediately
* @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
* @throws IOException
*/
-private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
+private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, boolean allowTag, String searchContext, int exitState, int immediateFallbackState) throws IOException {
boolean stillSearching = true;
boolean wasBlockingEnabled = fIsBlockingEnabled;
try {
@@ -1447,6 +1451,20 @@ private final String doScan(String searchString, boolean requireTailSeparator, b
}
return searchContext;
}
+ // 4) XML tag
+ else if(allowTag && checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart &&
+ yy_buffer[yy_currentPos - searchStringLength] == '<') {
+ fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
+ yy_currentPos = yy_markedPos + 1;
+ int resumeState = yystate();
+ yybegin(ST_XML_TAG_NAME);
+ if(yy_markedPos == yy_startRead) {
+ String jspContext = primGetNextToken();
+ yybegin(resumeState);
+ return jspContext;
+ }
+ return searchContext;
+ }
/**
@@ -1804,7 +1822,7 @@ private final String doBlockTagScan() throws IOException {
// XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
// case change to the ST_XML_COMMENT_END state and return the next
// context as usual.
- return doScan("-->", false, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
+ return doScan("-->", false, true, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
}
/* user method */
private final String scanJSPCommentText() throws IOException {
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
index 74b22f786d..21782c63b4 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
@@ -405,6 +405,9 @@ import org.eclipse.wst.xml.core.internal.parser.IntStack;
fCurrentTagName = newTagName;
}
+ private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
+ return doScan(searchString, requireTailSeparator, allowJSP, allowCDATA, false, searchContext, exitState, immediateFallbackState);
+ }
/**
* Method doScan.
*
@@ -414,13 +417,14 @@ import org.eclipse.wst.xml.core.internal.parser.IntStack;
* @param searchString - target string to search for ex.: "-->", "</tagname"
* @param requireTailSeparator - whether the target must be immediately followed by whitespace or '>'
* @param allowJSP - check for and allow for JSP markup <%%>
+ * @param allowTag - check for and allow for xml tags <
* @param context - the context of the scanned region if non-zero length
* @param exitState - the state to go to if the region was of non-zero length
* @param abortState - the state to go to if the searchString was found immediately
* @return String - the context found: the desired context on a non-zero length match, the abortContext on immediate success
* @throws IOException
*/
-private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
+private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, boolean allowTag, String searchContext, int exitState, int immediateFallbackState) throws IOException {
boolean stillSearching = true;
boolean wasBlockingEnabled = fIsBlockingEnabled;
try {
@@ -506,6 +510,20 @@ private final String doScan(String searchString, boolean requireTailSeparator, b
}
return searchContext;
}
+ // 4) XML tag
+ else if(allowTag && checkJSPs && yy_currentPos > searchStringLength && yy_currentPos - searchStringLength != fLastInternalBlockStart &&
+ yy_buffer[yy_currentPos - searchStringLength] == '<') {
+ fLastInternalBlockStart = yy_markedPos = yy_currentPos - searchStringLength;
+ yy_currentPos = yy_markedPos + 1;
+ int resumeState = yystate();
+ yybegin(ST_XML_TAG_NAME);
+ if(yy_markedPos == yy_startRead) {
+ String jspContext = primGetNextToken();
+ yybegin(resumeState);
+ return jspContext;
+ }
+ return searchContext;
+ }
/**
@@ -863,7 +881,7 @@ private final String doBlockTagScan() throws IOException {
// XML_COMMENT_TEXT unless the string occurs IMMEDIATELY, in which
// case change to the ST_XML_COMMENT_END state and return the next
// context as usual.
- return doScan("-->", false, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
+ return doScan("-->", false, true, true, true, XML_COMMENT_TEXT, ST_XML_COMMENT_END, ST_XML_COMMENT_END);
}
/* user method */
private final String scanJSPCommentText() throws IOException {

Back to the top