From 76ca906097e3f8f18a1b8963af1f2308f67b6d46 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 14 Oct 2015 16:02:33 -0400 Subject: [PATCH 1/2] Syntax is ArrayLiteralConvertible. --- prototype/Doubt/Syntax.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/prototype/Doubt/Syntax.swift b/prototype/Doubt/Syntax.swift index 47cf327c8..afe6562ff 100644 --- a/prototype/Doubt/Syntax.swift +++ b/prototype/Doubt/Syntax.swift @@ -42,6 +42,15 @@ public enum Syntax: CustomDebugStringConvertible, CustomDocConvertible } +// MARK: - ArrayLiteralConvertible + +extension Syntax: ArrayLiteralConvertible { + public init(arrayLiteral: Recur...) { + self = .Indexed(arrayLiteral) + } +} + + // MARK: - Equality extension Syntax { From 86df4c6a8706db5bfbe586bfd3888a6e1a1d5775 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 14 Oct 2015 16:03:14 -0400 Subject: [PATCH 2/2] Syntax is DictionaryLiteralConvertible. --- prototype/Doubt/Syntax.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/prototype/Doubt/Syntax.swift b/prototype/Doubt/Syntax.swift index afe6562ff..19f36ee3d 100644 --- a/prototype/Doubt/Syntax.swift +++ b/prototype/Doubt/Syntax.swift @@ -51,6 +51,15 @@ extension Syntax: ArrayLiteralConvertible { } +// MARK: - DictionaryLiteralConvertible + +extension Syntax: DictionaryLiteralConvertible { + public init(dictionaryLiteral elements: (String, Recur)...) { + self = .Keyed(Dictionary(elements: elements)) + } +} + + // MARK: - Equality extension Syntax {