1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Merge pull request #109 from github/literal-syntax-construction

Literal syntax construction
This commit is contained in:
Josh Vera 2015-10-14 16:44:25 -04:00
commit 99c4e8556e

View File

@ -42,6 +42,24 @@ public enum Syntax<Recur, A>: CustomDebugStringConvertible, CustomDocConvertible
}
// MARK: - ArrayLiteralConvertible
extension Syntax: ArrayLiteralConvertible {
public init(arrayLiteral: Recur...) {
self = .Indexed(arrayLiteral)
}
}
// MARK: - DictionaryLiteralConvertible
extension Syntax: DictionaryLiteralConvertible {
public init(dictionaryLiteral elements: (String, Recur)...) {
self = .Keyed(Dictionary(elements: elements))
}
}
// MARK: - Equality
extension Syntax {