2002/css-validator/org/w3c/css/parser/analyzer CssParser.jj,1.61,1.62

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

Modified Files:
	CssParser.jj 
Log Message:
using localised version of the error string, use new CssParseException instead of parseException when needed.


Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- CssParser.jj	17 Feb 2009 15:58:48 -0000	1.61
+++ CssParser.jj	17 Feb 2009 16:54:38 -0000	1.62
@@ -666,9 +666,8 @@
 				  ac.getMsg().getString("parser.charset"));
 		}
 		if ("css1".equals(ac.getCssVersion())) {
-		    throw new ParseException("No @charset rule is allowed "+
-					     "in CSS1");
-		    /* ac.getMsg().getString("parser.charsetcss1") */
+		    throw new ParseException(ac.getMsg().getString(
+							 "parser.charsetcss1"));
 		}
 	        // stricter rule for CSS21 and soon for CSS3
 		if ("css21".equals(ac.getCssVersion())) {
@@ -1651,11 +1650,21 @@
   <RBRACKET>
       {
 	  if ("css1".equals(ac.getCssVersion())) {
+	      StringBuilder reason;
+	      CssParseException cp;
 	      ParseException p;
-	      p = new ParseException("attribute selectors are invalid "+
-				     "in CSS1");
-	      /* ParseException(ac.getMsg().getString("parser.attrcss1")) */
-	      ac.getFrame().addError(new CssError(p));
+	      reason = new StringBuilder(" [");
+	      if (att != null) {
+		  reason.append(convertIdent(att.image));
+	      }
+	      if (val != null ) {
+		  reason.append('=').append(val.image);
+	      }
+	      reason.append(']');
+	      p = new ParseException(ac.getMsg().getString("parser.attrcss1")+
+				     reason.toString());
+	      cp = new CssParseException(p);
+	      ac.getFrame().addError(new CssError(cp));
 	      removeThisRule();
 	  }
 	  if (selectorType == CssSelectors.ATTRIBUTE_ANY) {

Received on Tuesday, 17 February 2009 16:54:50 UTC