   case Null = "null"
   case True = "true"
   case False = "false"
-  case PositiveInfinity = "+infinity"
-  case NegativeInfinity = "-infinity"
+  case InfinityP = "+infinity"
+  case InfinityN = "-infinity"
   case NaN = "nan"
   case Float = "float"
   case Int = "int"
   case IntOct = "int-oct"
   case IntHex = "int-hex"
+  case End = "end"
 
   var description: String {
     return self.toRaw()

  (.Null, "^(null|Null|NULL|~)\(finish)"),
  (.True, "^(true|True|TRUE)\(finish)"),
  (.False, "^(false|False|FALSE)\(finish)"),
  (.PositiveInfinity, "^\\+?\\.(inf|Inf|INF)\(finish)"),
  (.NegativeInfinity, "^-\\.(inf|Inf|INF)\(finish)"),
  (.NaN, "^\\.(nan|NaN|NAN)\(finish)"),
  (.Int, "^[-+]?[0-9]+\(finish)"),
  (.IntOct, "^0o[0-7]+\(finish)"),

    self.tokens = tokens
  }

  func peek() -> TokenMatch {
    return tokens[index]
  }

  func advance() -> TokenMatch {
    let r = tokens[index]
    index += 1
    return r
  }

  func parse() -> Yaml {
    switch peek().type {

    case .Comment, .Space:
      advance()
      return parse()

    case .Null:
      advance()
      return .Null

    case .True:
      advance()
      return .Bool(true)

    case .False:
      advance()
      return .Bool(false)

    case .Int:
      let m = advance().match as NSString
      return .Int(m.integerValue) // what about overflow?

    case .IntOct:
      let m = advance().match.stringByReplacingOccurrencesOfString("0o", withString: "")
      return .Int(parseInt(m, radix: 8))

    case .IntHex:
      let m = advance().match.stringByReplacingOccurrencesOfString("0x", withString: "")
      return .Int(parseInt(m, radix: 16))

    case .InfinityP:
      advance()
      return .Float(Float.infinity)

    case .InfinityN:
      advance()
      return .Float(-Float.infinity)

    case .NaN:
      advance()
      return .Float(Float.NaN)

    case .Float:
      let m = advance().match as NSString
      return .Float(m.floatValue)

    case .End:
      return .Null

    }
  }
}

