1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Remove not combinator

This commit is contained in:
joshvera 2015-10-21 11:11:36 -04:00
parent f949bddaa2
commit 81dc6c602e

View File

@ -27,15 +27,6 @@ extension String: CollectionType {
}
}
func not<C: CollectionType, T>(parser: Parser<C, T>.Function)(_ input: C, _ index: C.Index) -> Either<Error<C.Index>, (C.Generator.Element, C.Index)> {
if index.distanceTo(input.endIndex) <= 0 || parser(input, index).right != nil {
return .Left(Error(reason: "", index: index, children: []))
} else {
return .Right(input[index], index.successor())
}
}
typealias StringParser = Parser<String, String>.Function
typealias CharacterParser = Parser<String, [Character]>.Function