 
 public func ~ (left : ParserRule, right: ParserRule) -> ParserRule {
     return {(parser: Parser, reader: Reader) -> Bool in
-        return left(parser: parser, reader: reader) && right(parser: parser, reader: reader)
+        parser.enter("~")
+        let res = left(parser: parser, reader: reader) && right(parser: parser, reader: reader)
+        parser.leave("~", res)
+        return res
     }
 }
 

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

// match a range of characters eg: "0"-"9"
public func - (left: Character, right: Character) -> ParserRule {
    return {(parser: Parser, reader: Reader) -> Bool in
        parser.enter("range [\(left)-\(right)]")
        
        let pos = reader.position
        
