diff options
author | nsandonato | 2010-11-17 18:31:16 +0000 |
---|---|---|
committer | nsandonato | 2010-11-17 18:31:16 +0000 |
commit | 819d9679c6236ac9b8104aeeca609d019692148c (patch) | |
tree | a52e5cd28560aef92a28c1de24d8215e99402d84 /bundles/org.eclipse.jst.jsp.core | |
parent | 7b02490e20db5864f6e381e8a8a57d3489ab5e86 (diff) | |
download | webtools.sourceediting-819d9679c6236ac9b8104aeeca609d019692148c.tar.gz webtools.sourceediting-819d9679c6236ac9b8104aeeca609d019692148c.tar.xz webtools.sourceediting-819d9679c6236ac9b8104aeeca609d019692148c.zip |
[326193] [parser]Empty end tag is ignored in xml comment text if there is a jsp expression in the tag's attribute value
Diffstat (limited to 'bundles/org.eclipse.jst.jsp.core')
-rw-r--r-- | bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java | 22 |
1 files changed, 20 insertions, 2 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 { |