2002/css-validator/org/w3c/css/parser/analyzer CssParser.jj,1.43,1.44

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

Modified Files:
	CssParser.jj 
Log Message:
fix for the definition of hash-classes, now '#' <IDENT>, and HASH is caught to throw an error as an unrecognized selector.
It closes bug 4999 http://www.w3.org/Bugs/Public/show_bug.cgi?id=4999

In addition, #.55ft is no longer recognized (which is normal), but .55ft is now recognized and warning is sent as it should.


Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- CssParser.jj	6 Feb 2009 10:22:33 -0000	1.43
+++ CssParser.jj	10 Feb 2009 13:10:09 -0000	1.44
@@ -10,7 +10,7 @@
 options {
     IGNORE_CASE  = true;
     STATIC = false;
-    /*
+    /*    
           DEBUG_TOKEN_MANAGER = true; 
 	  DEBUG_PARSER = true;      
     */
@@ -417,10 +417,11 @@
 <DEFAULT>
 TOKEN :
 {
-    <STRING  : <_STRING> >
-  | <INVALID : <_INVALID> >
-  | <IDENT   : <_IDENT> >
-  | <HASH    : "#" <NAME> >
+    <STRING    : <_STRING> >
+  | <INVALID   : <_INVALID> >
+  | <IDENT     : <_IDENT> >
+  | <HASH      : "#" <NAME> >
+  | <HASHIDENT : "#" <_IDENT> >
 }
 
 <DEFAULT>
@@ -1390,7 +1391,7 @@
 	}
     } 
     /* FIXME <DOT> n=deprecated_class() ... ?? (DONE-> to be tested) */ 
-    | <DOT> n=deprecated_class() {
+    | ( n=deprecated_class() ) {
 	if (n.image.charAt(0) == '.') {
 	    n.image = n.image.substring(1);
           
@@ -1628,7 +1629,7 @@
 void hash(CssSelectors s) :
 {Token n; }
 {
-  n=<HASH>  {
+  n=<HASHIDENT>  {
       n.image = n.image.substring(1);
       if(Character.isDigit(n.image.charAt(0))) { 
 	  String profile = ac.getProfile();
@@ -1688,6 +1689,9 @@
 	  }
       }
   }
+  | n=<HASH> {
+   throw new ParseException("Unrecognized ");
+   }
 }
 
 /**

Received on Tuesday, 10 February 2009 13:10:20 UTC