W3C home > Mailing lists > Public > www-validator-cvs@w3.org > March 2008

2002/css-validator/org/w3c/css/parser/analyzer CssParser.jj,1.38,1.39

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 28 Mar 2008 15:05:12 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1JfG8m-0008DK-9R@lionel-hutz.w3.org>

Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv31515

Modified Files:
	CssParser.jj 
Log Message:
added more rules for charset in CSS21
STRING must not start with ', only with " (and should end that way too, but the lexer is taking care of that)


Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- CssParser.jj	28 Mar 2008 14:58:43 -0000	1.38
+++ CssParser.jj	28 Mar 2008 15:05:10 -0000	1.39
@@ -612,18 +612,20 @@
 		    throw new ParseException(
 					     ac.getMsg().getString("parser.charset"));                    
 		}
-		// the @charset is case sensitive
-		if (!"@charset".equals(charsetToken.image)) {
-		    throw new ParseException(
-			ac.getMsg().getString("parser.charsetspecial"));   
-		}
 	        // stricter rule for CSS21 and soon for CSS3
 		if ("css21".equals(ac.getCssVersion())) {
+		    // single space before
+		    // case sensitive
+		    // no space before ;
+		    // no comments
+		    // string must start with "
 		    if ( (nb_S != 1) ||
+			 (!"@charset".equals(charsetToken.image)) ||
 			 (!" ".equals(space1Token.image)) || 
 			 (space2Token != null && !"".equals(space2Token.image)) ||
 			 (space1Token.specialToken != null) ||
-			 (semicolonToken.specialToken != null)
+			 (semicolonToken.specialToken != null) ||
+			 (n.image.charAt(0) != '\"')
 			) {
 			throw new ParseException(ac.getMsg().getString(
 						     "parser.charsetspecial"));
Received on Friday, 28 March 2008 15:05:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:00 GMT