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:
parent
b80e8cb527
commit
bcec39379d
@ -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* }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user