1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Add a root parser taking multiple sexprs.

This commit is contained in:
Rob Rix 2015-09-18 16:36:14 -04:00
parent ca5298da88
commit ab4ec9e0aa

View File

@ -16,6 +16,8 @@ enum Swift: Equatable {
static let keyValue = KeyValue <^> (word <* ^"=" <*> (quoted <|> atom))
static let branch: String -> State<Swift>? = Branch <^> (^"(" *> ws* *> word <* ws* <*> sexpr* <* ws* <* ^")")
static let sexpr = delay { (branch <|> symbol <|> keyValue <|> (Swift.Atom <^> atom)) <* ws* }
static let root = ws* *> sexpr*
}
}