 public postfix func * (rule: ParserRule) -> ParserRule {
     return {(parser: Parser, reader: Reader) -> Bool in
         var flag: Bool
-        
-        if(parser.debug_rules) {
-            print("zero or more")
-        }
+        var matched = false
+        parser.enter("zero or more")
+        
         repeat {
             let pos = reader.position
             flag = rule(parser: parser, reader: reader)
             if(!flag) {
                 reader.seek(pos)
+            } else {
+                matched = true
             }
         } while(flag)
         
+        parser.leave("zero or more", matched)
         return true
     }
 }

prefix operator ^ {}
public prefix func ^(name:String) -> ParserRule {
    return {(parser: Parser, reader: Reader) -> Bool in
        if(parser.debug_rules) {
            print("named rule: \(name)")
        }
        // check to see if this would cause a recursive loop?
        if(parser.current_named_rule != name) {
            let old_named_rule = parser.current_named_rule


public func | (left: ParserRule, right: ParserRule) -> ParserRule {
    return {(parser: Parser, reader: Reader) -> Bool in
        parser.enter("|")
        let pos = reader.position
        var result = left(parser: parser, reader: reader)
        if(!result) {
