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:
parent
f949bddaa2
commit
81dc6c602e
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user