- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 04 Oct 2011 13:05:25 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer In directory hutz:/tmp/cvs-serv17942/org/w3c/css/parser/analyzer Modified Files: CssParser.java Log Message: some reordering to have only one background-color to check in checkConflicts (like what was done for CssColors Index: CssParser.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- CssParser.java 29 Sep 2011 09:08:58 -0000 1.76 +++ CssParser.java 4 Oct 2011 13:05:22 -0000 1.77 @@ -1,17 +1,49 @@ /* Generated By:JavaCC: Do not edit this line. CssParser.java */ package org.w3c.css.parser.analyzer; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Iterator; +import java.net.URL; + +import org.w3c.css.values.CssValue; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssString; +import org.w3c.css.values.CssURL; +import org.w3c.css.values.CssLength; +import org.w3c.css.values.CssNumber; +import org.w3c.css.values.CssColor; +import org.w3c.css.values.CssIdent; +import org.w3c.css.values.CssPercentage; +import org.w3c.css.values.CssFrequency; +import org.w3c.css.values.CssTime; +import org.w3c.css.values.CssDate; +import org.w3c.css.values.CssAngle; +import org.w3c.css.values.CssFunction; +import org.w3c.css.values.CssUnicodeRange; +import org.w3c.css.values.CssResolution; +import org.w3c.css.properties.css.CssProperty; +import org.w3c.css.parser.Frame; +import org.w3c.css.parser.CssError; +import org.w3c.css.parser.CssSelectors; +import org.w3c.css.parser.CssParseException; import org.w3c.css.parser.AtRule; -import org.w3c.css.parser.AtRuleFontFace; import org.w3c.css.parser.AtRuleMedia; +import org.w3c.css.parser.AtRuleFontFace; import org.w3c.css.parser.AtRulePage; -import org.w3c.css.parser.AtRulePhoneticAlphabet; import org.w3c.css.parser.AtRulePreference; -import org.w3c.css.parser.CssError; -import org.w3c.css.parser.CssParseException; -import org.w3c.css.parser.CssSelectors; -import org.w3c.css.properties.css.CssProperty; +import org.w3c.css.parser.AtRulePhoneticAlphabet; import org.w3c.css.properties.svg.AtRuleColorProfile; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.CssProfile; +import org.w3c.css.util.CssVersion; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.util.WarningParamException; +import org.w3c.css.util.Util; +import org.w3c.css.util.Messages; + import org.w3c.css.selectors.AdjacentSiblingSelector; import org.w3c.css.selectors.AttributeSelector; import org.w3c.css.selectors.ChildSelector; @@ -28,34 +60,6 @@ import org.w3c.css.selectors.attributes.AttributeStart; import org.w3c.css.selectors.attributes.AttributeSubstr; import org.w3c.css.selectors.attributes.AttributeSuffix; -import org.w3c.css.util.ApplContext; -import org.w3c.css.util.CssProfile; -import org.w3c.css.util.CssVersion; -import org.w3c.css.util.InvalidParamException; -import org.w3c.css.util.Util; -import org.w3c.css.util.WarningParamException; -import org.w3c.css.values.CssAngle; -import org.w3c.css.values.CssDate; -import org.w3c.css.values.CssExpression; -import org.w3c.css.values.CssFrequency; -import org.w3c.css.values.CssFunction; -import org.w3c.css.values.CssIdent; -import org.w3c.css.values.CssLength; -import org.w3c.css.values.CssNumber; -import org.w3c.css.values.CssPercentage; -import org.w3c.css.values.CssResolution; -import org.w3c.css.values.CssString; -import org.w3c.css.values.CssTime; -import org.w3c.css.values.CssURL; -import org.w3c.css.values.CssUnicodeRange; -import org.w3c.css.values.CssValue; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Iterator; /** * A CSS3 parser @@ -133,7 +137,7 @@ /** * Set the attribute mediaDeclaration * - * @param mediadeclaration indicator if in a media expression list or not + * @param mediaDeclaration indicator if in a media expression list or not */ public void setMediaDeclaration(String mediadeclaration) { this.mediaDeclaration = mediadeclaration; @@ -210,7 +214,7 @@ * * @param ident The ident for this at-rule (for example: 'font-face') * @param string The string associate to this at-rule - * @see Couple + * @see org.w3c.css.parser.Analyzer.Couple */ public abstract void handleAtRule(String ident, String string); @@ -238,7 +242,7 @@ * * @return <code>null</code>or a property * - * @see CssProperty + * @see org.w3c.css.css.CssProperty */ public abstract CssProperty handleDeclaration(String property, CssExpression values, @@ -276,7 +280,7 @@ /** * Set the URL of the style sheet. * - * @param url The URL for the style sheet + * @param URL The URL for the style sheet */ public final void setURL(URL url) { this.url = url; @@ -537,7 +541,7 @@ (space1Token.specialToken != null) || (n.specialToken != null) || (semicolonToken.specialToken != null) || - (n.image.charAt(0) != '"') + (n.image.charAt(0) != '\u005c"') ) { {if (true) throw new ParseException(ac.getMsg().getString( "parser.charsetspecial"));} @@ -726,7 +730,7 @@ ((CssURL) val).set(v.image, ac, url); nsname = (String) val.get(); if ((nsname.charAt(0) == '"') - || (nsname.charAt(0) == '\'')) { + || (nsname.charAt(0) == '\u005c'')) { nsname = nsname.substring(1, nsname.length()-1); } break; @@ -808,7 +812,7 @@ ((CssURL) val).set(n.image, ac, url); importFile = (String) val.get(); if ((importFile.charAt(0) == '"') - || (importFile.charAt(0) == '\'')) { + || (importFile.charAt(0) == '\u005c'')) { importFile = importFile.substring(1, importFile.length()-1); } is_url = true; @@ -2447,9 +2451,9 @@ if (p != null) { // FIXME should be > CSS3 if (ac.getCssVersion().compareTo(CssVersion.CSS3) < 0) { - StringBuilder sb = new StringBuilder("namespace \""); + StringBuilder sb = new StringBuilder("namespace \u005c""); if (n != null) sb.append(n.toString()); - sb.append('\"'); + sb.append("\u005c""); ac.getFrame().addError(new CssError(new InvalidParamException("notversion", "namespace", @@ -2461,8 +2465,8 @@ if (!ac.isNamespaceDefined(getURL(), prefix)) { // ns is not defined addError(new ParseException("Undefined namespace"), - ": The namespace \""+prefix - +"\" is not defined. " + ": The namespace \u005c""+prefix + +"\u005c" is not defined. " + prefix ); removeThisRule(); } @@ -2898,9 +2902,9 @@ addError(new ParseException(ac.getMsg().getString( "parser.old_id")), - "To make \"." + n.image + "\" a valid id, CSS2" + + "To make \u005c"." + n.image + "\u005c" a valid id, CSS2" + " requires the first digit to be escaped " + - "(\"#" + cl + "\")"); + "(\u005c"#" + cl + "\u005c")"); // for css > 1, we add the rule to have a context, // and we then remove it s.addId(new IdSelector(n.image)); @@ -3605,14 +3609,14 @@ int index = start; int t; int maxCount = 0; - if ((start == 0) && (len == s.length()) && (s.indexOf('\\') == -1)) { + if ((start == 0) && (len == s.length()) && (s.indexOf('\u005c\u005c') == -1)) { return s; } StringBuilder buf = new StringBuilder(len); while (index < len) { char c = s.charAt(index); - if (c == '\\') { + if (c == '\u005c\u005c') { if (++index < len) { c = s.charAt(index); switch (c) { @@ -3633,15 +3637,15 @@ numValue = (numValue<<4) | t; index++; } else { - if (c == ' ' || c == '\t' || - c == '\n' || c == '\f' ) { + if (c == ' ' || c == '\u005ct' || + c == '\u005cn' || c == '\u005cf' ) { // skip the latest white space index++; - } else if ( c == '\r' ) { + } else if ( c == '\u005cr' ) { index++; // special case for \r\n if (index+1 < len) { - if (s.charAt(index + 1) == '\n') { + if (s.charAt(index + 1) == '\u005cn') { index++; } } @@ -3657,7 +3661,7 @@ || (numValue == 45) // - ) ) { - buf.append('\\'); + buf.append('\u005c\u005c'); } buf.append((char) numValue); break; @@ -3668,14 +3672,14 @@ b[--t] = hexdigits[numValue & 0xF]; numValue >>>= 4; } - buf.append('\\').append(b); + buf.append('\u005c\u005c').append(b); break; - case '\n': - case '\f': + case '\u005cn': + case '\u005cf': break; - case '\r': + case '\u005cr': if (index + 1 < len) { - if (s.charAt(index + 1) == '\n') { + if (s.charAt(index + 1) == '\u005cn') { index ++; } } @@ -3694,7 +3698,7 @@ buf.append(c); break; default: - buf.append('\\').append(c); + buf.append('\u005c\u005c').append(c); } } else { throw new ParseException("invalid string"); @@ -3722,7 +3726,7 @@ String hexEscapeFirst(String s) throws ParseException { StringBuilder sb = new StringBuilder(); - sb.append('\\').append(Integer.toString(s.charAt(0), 16)); + sb.append('\u005c\u005c').append(Integer.toString(s.charAt(0), 16)); char c = s.charAt(1); if (((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'F')) ||
Received on Tuesday, 4 October 2011 13:05:57 UTC