1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Allow atoms to occur in branches.

This commit is contained in:
Rob Rix 2015-09-18 15:58:01 -04:00
parent b80e8cb527
commit bcec39379d

View File

@ -1,4 +1,5 @@
enum Swift: Equatable {
case Atom(String)
case KeyValue(String, String)
case Branch(String, [Swift])
@ -12,7 +13,7 @@ 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 <|> keyValue) <* ws* }
static let sexpr = delay { (branch <|> (Swift.Atom <^> atom) <|> keyValue) <* ws* }
}
}