Update of /var/cvs/src/org/mmbase/util/transformers
In directory james.mmbase.org:/tmp/cvs-serv15365

Modified Files:
        ListParser.jj 
Log Message:
fixed failing test-case


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/util/transformers


Index: ListParser.jj
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/transformers/ListParser.jj,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ListParser.jj       17 Jun 2008 10:20:31 -0000      1.3
+++ ListParser.jj       8 Jul 2008 15:54:46 -0000       1.4
@@ -13,7 +13,7 @@
  *
  * @author Michiel Meeuwisssen
  * @since MMBase-1.8.6
- * @version $Id: ListParser.jj,v 1.3 2008/06/17 10:20:31 michiel Exp $
+ * @version $Id: ListParser.jj,v 1.4 2008/07/08 15:54:46 michiel Exp $
  */
 
 options {
@@ -51,8 +51,8 @@
     int getDepth(Token t) {
         return t.image.length() - (begin ? 1 : 2);
     }
-    char getType(Token t) {
-        return t.image.charAt(begin ? 0 : 1) == '*' ? 'o' : 'u';
+    char getType(Token t, int depth) {
+        return t.image.charAt(depth - 1 +  (begin ? 0 : 1)) == '*' ? 'o' : 'u';
     }
     void open(StringBuilder buf, char type) {
         curDepth++;
@@ -68,7 +68,7 @@
     }
     void handleList(StringBuilder buf, Token t) {
         int depth = getDepth(t);
-        char type = getType(t);
+        char type = getType(t, depth);
         if (depth == curDepth + 1) {
             open(buf, type);
         } else if (depth == curDepth - 1) {
@@ -93,10 +93,10 @@
 
 PARSER_END(ListParser)
 
-TOKEN : { <BOL: "*" ("*")* (" ")> }
-TOKEN : { <BUL: "-" ("-")* (" ")> }
-TOKEN : { <OL: "\n*" ("*")* (" ")> }
-TOKEN : { <UL: "\n-" ("-")* (" ")> }
+TOKEN : { <BOL: "*" (["*","-"])* (" ")> }
+TOKEN : { <BUL: "-" (["*", "-"])* (" ")> }
+TOKEN : { <OL: "\n*" (["*", "-"])* (" ")> }
+TOKEN : { <UL: "\n-" (["*", "-"])* (" ")> }
 TOKEN : { <END: ("\n")> }
 TOKEN : { <OTHER : ~[] > }
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to