diff options
| author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-18 17:29:21 +0000 |
|---|---|---|
| committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-18 17:29:21 +0000 |
| commit | 64089cc9f030d8ef7972adb5d117e0b23f47d62b (patch) | |
| tree | 9f9c470de62ee62fba1331a396450d728d2b1fad /libjava/classpath/gnu/javax/swing/text/html | |
| parent | 96034e28360d660d7a7708807fcbc4b519574d8e (diff) | |
| download | ppe42-gcc-64089cc9f030d8ef7972adb5d117e0b23f47d62b.tar.gz ppe42-gcc-64089cc9f030d8ef7972adb5d117e0b23f47d62b.zip | |
Imported GNU Classpath 0.90
* scripts/makemake.tcl: LocaleData.java moved to gnu/java/locale.
* sources.am: Regenerated.
* gcj/javaprims.h: Regenerated.
* Makefile.in: Regenerated.
* gcj/Makefile.in: Regenerated.
* include/Makefile.in: Regenerated.
* testsuite/Makefile.in: Regenerated.
* gnu/java/lang/VMInstrumentationImpl.java: New override.
* gnu/java/net/local/LocalSocketImpl.java: Likewise.
* gnu/classpath/jdwp/VMMethod.java: Likewise.
* gnu/classpath/jdwp/VMVirtualMachine.java: Update to latest
interface.
* java/lang/Thread.java: Add UncaughtExceptionHandler.
* java/lang/reflect/Method.java: Implements GenericDeclaration and
isSynthetic(),
* java/lang/reflect/Field.java: Likewise.
* java/lang/reflect/Constructor.java
* java/lang/Class.java: Implements Type, GenericDeclaration,
getSimpleName() and getEnclosing*() methods.
* java/lang/Class.h: Add new public methods.
* java/lang/Math.java: Add signum(), ulp() and log10().
* java/lang/natMath.cc (log10): New function.
* java/security/VMSecureRandom.java: New override.
* java/util/logging/Logger.java: Updated to latest classpath
version.
* java/util/logging/LogManager.java: New override.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113887 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/gnu/javax/swing/text/html')
| -rw-r--r-- | libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java | 121 |
1 files changed, 82 insertions, 39 deletions
diff --git a/libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java b/libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java index cef94942e16..92f9b27c5d9 100644 --- a/libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java +++ b/libjava/classpath/gnu/javax/swing/text/html/parser/support/Parser.java @@ -934,7 +934,7 @@ public class Parser optional(WS); attributeReading: - while (getTokenAhead().kind == NUMTOKEN) + while (getTokenAhead().kind == NUMTOKEN) { name = getNextToken(); optional(WS); @@ -949,46 +949,90 @@ public class Parser switch (next.kind) { - case QUOT : - - // read "quoted" attribute. - buffer.setLength(0); - readTillTokenE(QUOT); - attrValue = buffer.toString(); - break; - - case AP : - - // read 'quoted' attribute. - buffer.setLength(0); - readTillTokenE(AP); - attrValue = buffer.toString(); - break; - - // read unquoted attribute. - case NUMTOKEN : - value = next; - optional(WS); - - // Check maybe the opening quote is missing. - next = getTokenAhead(); - if (bQUOTING.get(next.kind)) - { - hTag = next; - error("The value without opening quote is closed with '" + - next.getImage() + "'" - ); - } + case QUOT: + + // read "quoted" attribute. + buffer.setLength(0); + readTillTokenE(QUOT); + attrValue = buffer.toString(); + break; + + case AP: + + // read 'quoted' attribute. + buffer.setLength(0); + readTillTokenE(AP); + attrValue = buffer.toString(); + break; + + // read unquoted attribute. + case NUMTOKEN: + value = next; + optional(WS); + + // Check maybe the opening quote is missing. + next = getTokenAhead(); + if (bQUOTING.get(next.kind)) + { + hTag = next; + error("The value without opening quote is closed with '" + + next.getImage() + "'"); + attrValue = value.getImage(); + } + else if (next.kind == SLASH) + // The slash in this context is treated as the ordinary + // character, not as a token. The slash may be part of + // the unquoted URL. + { + StringBuffer image = new StringBuffer(value.getImage()); + while (next.kind == NUMTOKEN || next.kind == SLASH) + { + image.append(getNextToken().getImage()); + next = getTokenAhead(); + } + attrValue = image.toString(); + } + else attrValue = value.getImage(); - break; - - default : - break attributeReading; + break; + + case SLASH: + value = next; + optional(WS); + + // Check maybe the opening quote is missing. + next = getTokenAhead(); + if (bQUOTING.get(next.kind)) + { + hTag = next; + error("The value without opening quote is closed with '" + + next.getImage() + "'"); + attrValue = value.getImage(); + } + else if (next.kind == NUMTOKEN || next.kind == SLASH) + // The slash in this context is treated as the ordinary + // character, not as a token. The slash may be part of + // the unquoted URL. + { + StringBuffer image = new StringBuffer(value.getImage()); + while (next.kind == NUMTOKEN || next.kind == SLASH) + { + image.append(getNextToken().getImage()); + next = getTokenAhead(); + } + attrValue = image.toString(); + } + else + attrValue = value.getImage(); + break; + default: + break attributeReading; } attributes.addAttribute(name.getImage(), attrValue); optional(WS); } - else // The '=' is missing: attribute without value. + else + // The '=' is missing: attribute without value. { noValueAttribute(element, name.getImage()); } @@ -996,9 +1040,8 @@ public class Parser } /** - * Return string, corresponding the given named entity. - * The name is passed with the preceeding &, but without - * the ending semicolon. + * Return string, corresponding the given named entity. The name is passed + * with the preceeding &, but without the ending semicolon. */ protected String resolveNamedEntity(final String a_tag) { |

