diff options
Diffstat (limited to 'libjava/java/text/RuleBasedCollator.java')
-rw-r--r-- | libjava/java/text/RuleBasedCollator.java | 101 |
1 files changed, 51 insertions, 50 deletions
diff --git a/libjava/java/text/RuleBasedCollator.java b/libjava/java/text/RuleBasedCollator.java index c2cff5a0c8c..afb766ff8ae 100644 --- a/libjava/java/text/RuleBasedCollator.java +++ b/libjava/java/text/RuleBasedCollator.java @@ -1,5 +1,5 @@ /* RuleBasedCollator.java -- Concrete Collator Class - Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -435,56 +435,57 @@ main_parse_loop: continue; } - switch (c) { - case '!': - throw new ParseException - ("Modifier '!' is not yet supported by Classpath", i+base_offset); - case '<': - type = CollationSorter.GREATERP; - break; - case ';': - type = CollationSorter.GREATERS; - break; - case ',': - type = CollationSorter.GREATERT; - break; - case '=': - type = CollationSorter.EQUAL; - break; - case '\'': - eatingChars = !eatingChars; - doubleQuote = true; - break; - case '@': - if (ignoreChars) - throw new ParseException - ("comparison list has not yet been started. You may only use" - + "(<,;=&)", i+base_offset); - // Inverse the order of secondaries from now on. - nextIsModifier = true; - type = CollationSorter.INVERSE_SECONDARY; - break; - case '&': - type = CollationSorter.RESET; - if (stop_on_reset) - break main_parse_loop; - break; - default: - if (operator < 0) - throw new ParseException - ("operator missing at " + (i+base_offset), i+base_offset); - if (!eatingChars && - ((c >= 0x21 && c <= 0x2F) - || (c >= 0x3A && c <= 0x40) - || (c >= 0x5B && c <= 0x60) - || (c >= 0x7B && c <= 0x7E))) + switch (c) + { + case '!': throw new ParseException - ("unquoted punctuation character '"+c+"'", i+base_offset); - - //type = ignoreChars ? CollationSorter.IGNORE : -1; - sb.append(c); - break; - } + ("Modifier '!' is not yet supported by Classpath", i + base_offset); + case '<': + type = CollationSorter.GREATERP; + break; + case ';': + type = CollationSorter.GREATERS; + break; + case ',': + type = CollationSorter.GREATERT; + break; + case '=': + type = CollationSorter.EQUAL; + break; + case '\'': + eatingChars = !eatingChars; + doubleQuote = true; + break; + case '@': + if (ignoreChars) + throw new ParseException + ("comparison list has not yet been started. You may only use" + + "(<,;=&)", i + base_offset); + // Inverse the order of secondaries from now on. + nextIsModifier = true; + type = CollationSorter.INVERSE_SECONDARY; + break; + case '&': + type = CollationSorter.RESET; + if (stop_on_reset) + break main_parse_loop; + break; + default: + if (operator < 0) + throw new ParseException + ("operator missing at " + (i + base_offset), i + base_offset); + if (! eatingChars + && ((c >= 0x21 && c <= 0x2F) + || (c >= 0x3A && c <= 0x40) + || (c >= 0x5B && c <= 0x60) + || (c >= 0x7B && c <= 0x7E))) + throw new ParseException + ("unquoted punctuation character '" + c + "'", i + base_offset); + + //type = ignoreChars ? CollationSorter.IGNORE : -1; + sb.append(c); + break; + } if (type < 0) continue; |