1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +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*
}
}