W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2009

2002/css-validator/org/w3c/css/parser/analyzer CssParser.java,1.57,1.58

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 16 Feb 2009 17:54:04 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1LZ7fQ-0000Yh-F6@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv2099/org/w3c/css/parser/analyzer

Modified Files:
	CssParser.java 
Log Message:
generated

Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- CssParser.java	16 Feb 2009 12:16:34 -0000	1.57
+++ CssParser.java	16 Feb 2009 17:54:02 -0000	1.58
@@ -740,7 +740,7 @@
     }
         if (!ac.getCssVersion().equals("css3")) {
             addError(new InvalidParamException("at-rule", "@namespace", ac),
-                     n.toString());
+                     (n==null)?"default":n.toString());
         } else {
             if (v != null) {
                 handleNamespaceDeclaration(getURL(), prefix, nsname, is_url);
@@ -2009,7 +2009,8 @@
                 Token t = getToken(1);
                 StringBuffer s = new StringBuffer();
                 s.append(getToken(0).image);
-                while ((t.kind != COMMA) && (t.kind != LBRACE) && (t.kind != EOF)) {
+                while ((t.kind != COMMA) && (t.kind != LBRACE) &&
+                       (t.kind != EOF)) {
                     s.append(t.image);
                     getNextToken();
                     t = getToken(1);
@@ -2350,8 +2351,9 @@
  * @exception ParseException exception during the parse
  */
   final public void element_name(CssSelectors s) throws ParseException {
- Token n=null;
+    Token n=null;
     Token p=null;
+    String prefix = null;
     if (jj_2_1(2)) {
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case IDENT:
@@ -2391,29 +2393,30 @@
             //	    addError(new ParseException("namespace"), sb.toString());
                 //		ignoreStatement();
             } else if (n!=null) {
-                String nsprefix = convertIdent(n.image);
-                if (!ac.isNamespaceDefined(getURL(), nsprefix)) {
+                prefix = convertIdent(n.image);
+                if (!ac.isNamespaceDefined(getURL(), prefix)) {
                     // ns is not defined
                     addError(new ParseException("Undefined namespace"),
-                             ": The namespace \""+nsprefix
+                             ": The namespace \""+prefix
                              +"\" is not defined. "
-                             + nsprefix );
-                    ignoreStatement();
-                    //		skipStatement();
+                             + prefix );
+                    removeThisRule();
                 }
+            } else {
+                prefix = "";
             }
         }
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case IDENT:
       n = jj_consume_token(IDENT);
                   //              s.setElement(convertIdent(n.image), ac);
-        s.addType(new TypeSelector(convertIdent(n.image)));
+        s.addType(new TypeSelector(prefix, convertIdent(n.image)));
       break;
     case ANY:
       jj_consume_token(ANY);
         if (!ac.getCssVersion().equals("css1")) {
             //          s.setElement(null);
-            s.addUniversal(new UniversalSelector());
+            s.addUniversal(new UniversalSelector(prefix));
         } else {
             ac.getFrame().addError(new CssError(new InvalidParamException("notversion",
                                                                           "*", ac.getCssVersion(), ac)));
@@ -3641,14 +3644,6 @@
     finally { jj_save(0, xla); }
   }
 
-  final private boolean jj_3_1() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_83()) jj_scanpos = xsp;
-    if (jj_scan_token(98)) return true;
-    return false;
-  }
-
   final private boolean jj_3R_83() {
     Token xsp;
     xsp = jj_scanpos;
@@ -3659,6 +3654,14 @@
     return false;
   }
 
+  final private boolean jj_3_1() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_83()) jj_scanpos = xsp;
+    if (jj_scan_token(98)) return true;
+    return false;
+  }
+
   public CssParserTokenManager token_source;
   SimpleCharStream jj_input_stream;
   public Token token, jj_nt;
Received on Monday, 16 February 2009 17:54:12 GMT

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