[
  {
    "path": ".gitignore",
    "content": ".DS_Store\nbuild\nxcuserdata\n*.mode*\n*.pbxuser\n*.xcuserdatad\n*.xccheckout\n*.xcscmblueprint\n*.xctimeline\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"Carthage/Checkouts/Result\"]\n\tpath = Carthage/Checkouts/Result\n\turl = https://github.com/antitypical/Result.git\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: objective-c\nosx_image: xcode9\nbranches:\n  only:\n    - master\nxcode_workspace: Madness.xcworkspace\nscript:\n  - script/cibuild\nmatrix:\n  include:\n    - xcode_scheme: Madness-Mac\n      env:\n        - XCODE_SDK=macosx\n        - XCODE_ACTION=\"build test\"\n        - XCODE_DESTINATION=\"arch=x86_64\"\n    - xcode_scheme: Madness-Mac\n      env:\n        - XCODE_SDK=macosx\n        - XCODE_ACTION=\"build\"\n        - XCODE_DESTINATION=\"arch=x86_64\"\n        - XCODE_PLAYGROUND=\"Documentation/Collections.playground\"\n        - JOB=Collections.playground\n    - xcode_scheme: Madness-Mac\n      env:\n        - XCODE_SDK=macosx\n        - XCODE_ACTION=\"build\"\n        - XCODE_DESTINATION=\"arch=x86_64\"\n        - XCODE_PLAYGROUND=\"Documentation/Colours.playground\"\n        - JOB=Colours.playground\n    - xcode_scheme: Madness-Mac\n      env:\n        - XCODE_SDK=macosx\n        - XCODE_ACTION=\"build\"\n        - XCODE_DESTINATION=\"arch=x86_64\"\n        - XCODE_PLAYGROUND=\"Documentation/Lambda Calculus.playground\"\n        - JOB=Lambda Calculus.playground\n    - xcode_scheme: Madness-Mac\n      env:\n        - XCODE_SDK=macosx\n        - XCODE_ACTION=\"build\"\n        - XCODE_DESTINATION=\"arch=x86_64\"\n        - XCODE_PLAYGROUND=\"Documentation/Subset of Common Markdown.playground\"\n        - JOB=Subset of Common Markdown.playground\n    - xcode_scheme: Madness-iOS\n      env:\n        - XCODE_SDK=iphonesimulator\n        - XCODE_ACTION=\"build-for-testing test-without-building\"\n        - XCODE_DESTINATION=\"platform=iOS Simulator,name=iPhone X\"\nnotifications:\n  email: false\n"
  },
  {
    "path": "Cartfile",
    "content": "github \"antitypical/Result\" ~> 3.2.4\n"
  },
  {
    "path": "Cartfile.resolved",
    "content": "github \"antitypical/Result\" \"3.2.4\"\n"
  },
  {
    "path": "Documentation/Collections.playground/Contents.swift",
    "content": "import Madness\nimport Result\n\nlet input = [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]\n\ntypealias Fibonacci = Parser<[Int], [Int]>.Function\n\nfunc fibonacci(_ x: Int, _ y: Int) -> Fibonacci {\n\tlet combined: Fibonacci = %(x + y) >>- { (xy: Int) -> Fibonacci in\n\t\t{ [ xy ] + $0 } <^> fibonacci(y, xy)\n\t}\n\treturn combined <|> pure([])\n}\n\nparse(fibonacci(0, 1), input: input).value\n\n"
  },
  {
    "path": "Documentation/Collections.playground/contents.xcplayground",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<playground version='3.0' sdk='macosx' auto-termination-delay='5'>\n    <sections>\n        <code source-file-name='section-1.swift'/>\n        <code source-file-name='section-2.swift'/>\n    </sections>\n    <timeline fileName='timeline.xctimeline'/>\n</playground>"
  },
  {
    "path": "Documentation/Colours.playground/Contents.swift",
    "content": "import Cocoa\nimport Darwin\nimport Madness\n\nfunc toComponent(_ string: String) -> CGFloat {\n  return CGFloat(strtol(string, nil, 16)) / 255\n}\n\nlet digit = %(\"0\"...\"9\")\nlet lower = %(\"a\"...\"f\")\nlet upper = %(\"A\"...\"F\")\nlet hex = digit <|> lower <|> upper\nlet hex2 = lift(+) <*> hex <*> hex\nlet component1: Parser<String.CharacterView, CGFloat>.Function = { toComponent($0 + $0) } <^> hex\nlet component2: Parser<String.CharacterView, CGFloat>.Function = toComponent <^> hex2\nlet three: Parser<String.CharacterView, [CGFloat]>.Function = component1 * 3\nlet six: Parser<String.CharacterView, [CGFloat]>.Function = component2 * 3\n\nlet colour: Parser<String.CharacterView, NSColor>.Function = map({\n\tNSColor(calibratedRed: $0[0], green: $0[1], blue: $0[2], alpha: 1)\n})(%\"#\" *> (six <|> three))\n\nlet reddish = parse(colour, input: \"#d52a41\").value\nlet greenish = parse(colour, input: \"#5a2\").value\nlet blueish = parse(colour, input: \"#5e8ca1\").value\n\n"
  },
  {
    "path": "Documentation/Colours.playground/contents.xcplayground",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<playground version='5.0' sdk='macosx' auto-termination-delay='4'>\n    <timeline fileName='timeline.xctimeline'/>\n</playground>\n"
  },
  {
    "path": "Documentation/Lambda Calculus.playground/Contents.swift",
    "content": "import Madness\n\nindirect enum Lambda: CustomStringConvertible {\n\tcase variable(String)\n\tcase abstraction(String, Lambda)\n\tcase application(Lambda, Lambda)\n    \n\tvar description: String {\n\t\tswitch self {\n\t\tcase let .variable(symbol):\n\t\t\treturn symbol\n\t\tcase let .abstraction(symbol, body):\n\t\t\treturn \"λ\\(symbol).\\(body.description)\"\n\t\tcase let .application(x, y):\n\t\t\treturn \"(\\(x.description) \\(y.description))\"\n\t\t}\n\t}\n}\n\ntypealias LambdaParser = Parser<String.CharacterView, Lambda>\n\nfunc lambda(_ input: String.CharacterView, sourcePos: SourcePos<String.CharacterView.Index>) -> LambdaParser.Result {\n\tlet symbol: StringParser = %(\"a\"...\"z\")\n\n\tlet variable: LambdaParser.Function = Lambda.variable <^> symbol\n\tlet abstraction: LambdaParser.Function = Lambda.abstraction <^> ( lift(pair) <*> (%\"λ\" *> symbol) <*> (%\".\" *> lambda) )\n\tlet application: LambdaParser.Function = Lambda.application <^> ( lift(pair) <*> (%\"(\" *> lambda) <*> (%\" \" *> lambda) <* %\")\" )\n\t\n\tlet parser: LambdaParser.Function = variable <|> abstraction <|> application\n\treturn parser(input, sourcePos)\n}\n\nparse(lambda, input: \"λx.(x x)\".characters).value?.description\nparse(lambda, input: \"(λx.(x x) λx.(x x))\".characters).value?.description\n\n"
  },
  {
    "path": "Documentation/Lambda Calculus.playground/contents.xcplayground",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<playground version='3.0' sdk='macosx' auto-termination-delay='5'>\n    <sections>\n        <code source-file-name='section-1.swift'/>\n        <code source-file-name='section-2.swift'/>\n    </sections>\n    <timeline fileName='timeline.xctimeline'/>\n</playground>"
  },
  {
    "path": "Documentation/Subset of Common Markdown.playground/Contents.swift",
    "content": "import Madness\n\n// MARK: - Lexing rules\n\nlet newline = %\"\\n\"\nlet ws = %\" \" <|> %\"\\t\"\nlet lower = %(\"a\"...\"z\")\nlet upper = %(\"A\"...\"Z\")\nlet digit = %(\"0\"...\"9\")\nlet text = lower <|> upper <|> digit <|> ws\nlet restOfLine = { $0.joined(separator: \"\") } <^> many(text) <* newline\nlet texts = { $0.joined(separator: \"\") } <^> some(text <|> (%\"\" <* newline))\n\n// MARK: - AST\n\nenum Node: CustomStringConvertible {\n\tcase blockquote([Node])\n\tcase header(Int, String)\n\tcase paragraph(String)\n    \n    func analysis<T>(ifBlockquote: ([Node]) -> T, ifHeader: (Int, String) -> T, ifParagraph: (String) -> T) -> T {\n\t\tswitch self {\n\t\tcase let .blockquote(nodes):\n\t\t\treturn ifBlockquote(nodes)\n\t\tcase let .header(level, text):\n\t\t\treturn ifHeader(level, text)\n\t\tcase let .paragraph(text):\n\t\t\treturn ifParagraph(text)\n\t\t}\n\t}\n\n\t// MARK: Printable\n\n\tvar description: String {\n\t\treturn analysis(\n\t\t\tifBlockquote: { \"<blockquote>\" + $0.lazy.map{ $0.description }.joined(separator: \"\") + \"</blockquote>\" },\n\t\t\tifHeader: { \"<h\\($0)>\\($1)</h\\($0)>\" },\n\t\t\tifParagraph: { \"<p>\\($0)</p>\" })\n\t}\n}\n\n\n// MARK: - Parsing rules\n\ntypealias NodeParser = Parser<String.CharacterView, Node>.Function\ntypealias ElementParser = (@escaping StringParser) -> NodeParser\n\nfunc fix<T, U>(_ f: @escaping (@escaping (T) -> U) -> (T) -> U) -> (T) -> U {\n    return { f(fix(f))($0) }\n}\n\nlet element: ElementParser = fix { element in\n\t{ prefix in\n\n\t\tlet octothorpes: IntParser = { $0.count } <^> (%\"#\" * (1..<7))\n\t\tlet header: NodeParser = prefix *> ( Node.header <^> (lift(pair) <*> octothorpes <*> (%\" \" *> restOfLine)) )\n\t\tlet paragraph: NodeParser = prefix *> ( Node.paragraph <^> texts )\n\t\tlet blockquote: NodeParser = prefix *> { ( Node.blockquote <^> some(element(prefix *> %\"> \")) )($0, $1) }\n\t\t\n\t\treturn header <|> paragraph <|> blockquote\n\t}\n}\n\nlet parser = many(element(pure(\"\")))\nif let parsed = parse(parser, input: \"> # hello\\n> \\n> hello\\n> there\\n> \\n> \\n\").value {\n    let description = parsed.reduce(\"\"){ $0 + $1.description }\n\tprint(description)\n}\n\nif let parsed = parse(parser, input: \"This is a \\nparagraph\\n> # title\\n> ### subtitle\\n> a\").value {\n    let description = parsed.reduce(\"\"){ $0 + $1.description }\n\tprint(description)\n}\n\n"
  },
  {
    "path": "Documentation/Subset of Common Markdown.playground/contents.xcplayground",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<playground version='3.0' sdk='macosx'>\n    <sections>\n        <code source-file-name='section-1.swift'/>\n        <code source-file-name='section-2.swift'/>\n    </sections>\n    <timeline fileName='timeline.xctimeline'/>\n</playground>"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Rob Rix\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "Madness/Alternation.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\n/// Parses `parser` 0 or one time.\npublic postfix func |? <C: Collection, T> (parser: @escaping Parser<C, T>.Function) -> Parser<C, T?>.Function {\n    return { $0.first } <^> parser * (0...1)\n}\n\n/// Parses either `left` or `right` and coalesces their trees.\npublic func <|> <C: Collection, T> (left: @escaping Parser<C, T>.Function, right: @escaping Parser<C, T>.Function) -> Parser<C, T>.Function {\n\treturn alternate(left, right)\n}\n\n\n// MARK: - n-ary alternation\n\n/// Alternates over a sequence of literals, coalescing their parse trees.\npublic func oneOf<C: Collection, S: Sequence>(_ input: S) -> Parser<C, C.Element>.Function where C.Element: Equatable, S.Element == C.Element {\n\treturn satisfy(input.contains)\n}\n\n/// Given a set of literals, parses an array of any matches in the order they were found.\n///\n/// Each literal will only match the first time.\npublic func anyOf<C: Collection>(_ set: Set<C.Element>) -> Parser<C, [C.Element]>.Function {\n\treturn oneOf(set) >>- { match in\n\t\tvar rest = set\n\t\trest.remove(match)\n\t\treturn prepend(match) <^> anyOf(rest) <|> pure([match])\n\t}\n}\n\n/// Given a set of literals, parses an array of all matches in the order they were found.\n///\n/// Each literal will be matched as many times as it is found.\npublic func allOf<C: Collection>(_ input: Set<C.Element>) -> Parser<C, [C.Element]>.Function {\n\treturn oneOf(input) >>- { match in\n\t\tprepend(match) <^> allOf(input) <|> pure([match])\n\t}\n}\n\n\n// MARK: - Private\n\n/// Defines alternation for use in the `<|>` operator definitions above.\nprivate func alternate<C: Collection, T>(_ left: @escaping Parser<C, T>.Function, _ right: @escaping Parser<C, T>.Function) -> Parser<C, T>.Function {\n\treturn { input, sourcePos in\n\t\treturn left(input, sourcePos)\n\t\t\t.flatMapError { left in\n\t\t\t\treturn right(input, sourcePos)\n\t\t\t\t\t.mapError { right in\n\t\t\t\t\t\treturn Error.withReason(\"no alternative matched:\", sourcePos)(left, right)\n\t\t\t\t\t}\n\t\t\t}\n\t}\n}\n\n\n/// Curried function that prepends a value to an array.\nfunc prepend<T>(_ value: T) -> ([T]) -> [T] {\n\treturn { [value] + $0 }\n}\n\n\n// MARK: - Operators\n\n/// Optional alternation operator.\npostfix operator |?\n\nprecedencegroup AlternationPrecedence {\n\tassociativity: left\n\thigherThan: ChainingPrecedence\n\tlowerThan: MultiplicationPrecedence\n}\n\ninfix operator <|> : AlternationPrecedence\n\n\n// MARK: - Imports\n\nimport Result\n"
  },
  {
    "path": "Madness/Combinator.swift",
    "content": "//  Copyright © 2015 Rob Rix. All rights reserved.\n\n/// Parses `open`, followed by `parser` and `close`. Returns the value returned by `parser`.\npublic func between<C: Collection, T, U, V>(_ open: @escaping Parser<C, T>.Function, _ close: @escaping Parser<C, U>.Function) -> (@escaping Parser<C, V>.Function) -> Parser<C, V>.Function {\n\treturn { open *> $0 <* close }\n}\n\n/// Parses 0 or more `parser` until `end`. Returns the list of values returned by `parser`.\npublic func manyTill<C: Collection, T, U>(_ parser: @escaping Parser<C, T>.Function, _ end: @escaping Parser<C, U>.Function) -> Parser<C, [T]>.Function {\n\treturn many(parser) <* end\n}\n"
  },
  {
    "path": "Madness/Concatenation.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nimport Result\n\nprecedencegroup ConcatenationPrecedence {\n\tassociativity: left\n\thigherThan: AlternationPrecedence\n\tlowerThan: MultiplicationPrecedence\n}\n\n/// Parses the concatenation of `left` and `right`, pairing their parse trees.\npublic func <*> <C: Collection, T, U> (left: @escaping Parser<C, (T) -> U>.Function, right: @escaping Parser<C, T>.Function) -> Parser<C, U>.Function {\n\treturn left >>- { $0 <^> right }\n}\n\n/// Parses the concatenation of `left` and `right`, dropping `right`’s parse tree.\npublic func <* <C: Collection, T, U> (left: @escaping Parser<C, T>.Function, right: @escaping Parser<C, U>.Function) -> Parser<C, T>.Function {\n\treturn left >>- { x in { _ in x } <^> right }\n}\n\n/// Parses the concatenation of `left` and `right`, dropping `left`’s parse tree.\npublic func *> <C: Collection, T, U> (left: @escaping Parser<C, T>.Function, right: @escaping Parser<C, U>.Function) -> Parser<C, U>.Function {\n\treturn left >>- { _ in right }\n}\n\n\ninfix operator <*> : ConcatenationPrecedence\n\ninfix operator *> : ConcatenationPrecedence\n\ninfix operator <* : ConcatenationPrecedence\n"
  },
  {
    "path": "Madness/Error.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nimport Result\n\n/// A composite error.\npublic enum Error<I: Comparable>: Swift.Error, CustomStringConvertible {\n\tindirect case branch(String, SourcePos<I>, [Error])\n\n\t/// Constructs a leaf error, e.g. for terminal parsers.\n\tpublic static func leaf(_ reason: String, _ sourcePos: SourcePos<I>) -> Error {\n\t\treturn .branch(reason, sourcePos, [])\n\t}\n\n\tpublic static func withReason(_ reason: String, _ sourcePos: SourcePos<I>) -> (Error, Error) -> Error {\n\t\treturn { Error(reason: reason, sourcePos: sourcePos, children: [$0, $1]) }\n\t}\n\n\tpublic init(reason: String, sourcePos: SourcePos<I>, children: [Error]) {\n\t\tself = .branch(reason, sourcePos, children)\n\t}\n\n\n\tpublic var reason: String {\n\t\tswitch self {\n\t\tcase let .branch(s, _, _):\n\t\t\treturn s\n\t\t}\n\t}\n\n\tpublic var sourcePos: SourcePos<I> {\n\t\tswitch self {\n\t\tcase let .branch(_, sourcePos, _):\n\t\t\treturn sourcePos\n\t\t}\n\t}\n\n\tpublic var children: [Error] {\n\t\tswitch self {\n\t\tcase let .branch(_, _, c):\n\t\t\treturn c\n\t\t}\n\t}\n\n\n\tpublic var depth: Int {\n\t\treturn 1 + ((children.sorted { $0.depth < $1.depth }).last?.depth ?? 0)\n\t}\n\n\n\t// MARK: Printable\n\t\n\tpublic var description: String {\n\t\treturn describe(0)\n\t}\n\n\tfileprivate func describe(_ n: Int) -> String {\n\t\tlet description = String(repeating: \"\\t\", count: n) + \"\\(sourcePos.index): \\(reason)\"\n\t\tif children.count > 0 {\n\t\t\treturn description + \"\\n\" + children.lazy.map { $0.describe(n + 1) }.joined(separator: \"\\n\")\n\t\t}\n\t\treturn description\n\t}\n}\n\n\n/// MARK: - Annotations\n\n/// Annotate a parser with a name.\npublic func <?> <C: Collection, T>(parser: @escaping Parser<C, T>.Function, name: String) -> Parser<C, T>.Function {\n\treturn describeAs(name)(parser)\n}\n\n/// Adds a name to parse errors.\npublic func describeAs<C: Collection, T>(_ name: String) -> (@escaping Parser<C, T>.Function) -> Parser<C, T>.Function {\n\treturn { parser in\n\t\t{ input, index in\n\t\t\treturn parser(input, index).mapError {\n\t\t\t\tError(reason: \"\\(name): \\($0.reason)\", sourcePos: $0.sourcePos, children: $0.children)\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// MARK: - Operators\n\nprecedencegroup AnnotationPrecedence {\n\tassociativity: left\n\tlowerThan: ChainingPrecedence\n}\n\ninfix operator <?> : AnnotationPrecedence\n"
  },
  {
    "path": "Madness/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>FMWK</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>0.0.1</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>$(CURRENT_PROJECT_VERSION)</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2014 Rob Rix. All rights reserved.</string>\n\t<key>NSPrincipalClass</key>\n\t<string></string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Madness/Madness.h",
    "content": "//  Copyright (c) 2014 Rob Rix. All rights reserved.\n\n/// Project version number for Madness.\nextern double MadnessVersionNumber;\n\n/// Project version string for Madness.\nextern const unsigned char MadnessVersionString[];\n\n"
  },
  {
    "path": "Madness/Map.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\n// MARK: - flatMap\n\n/// Returns a parser which requires `parser` to parse, passes its parsed trees to a function `f`, and then requires the result of `f` to parse.\n///\n/// This can be used to conveniently make a parser which depends on earlier parsed input, for example to parse exactly the same number of characters, or to parse structurally significant indentation.\npublic func >>- <C: Collection, T, U> (parser: @escaping Parser<C, T>.Function, f: @escaping (T) -> Parser<C, U>.Function) -> Parser<C, U>.Function {\n\treturn { input, index in parser(input, index).flatMap { f($0)(input, $1) } }\n}\n\n\n// MARK: - map\n\n/// Returns a parser which applies `f` to transform the output of `parser`.\npublic func <^> <C: Collection, T, U> (f: @escaping (T) -> U, parser: @escaping Parser<C, T>.Function) -> Parser<C, U>.Function {\n\treturn parser >>- { pure(f($0)) }\n}\n\n/// Returns a parser which first parses `right`, replacing successful parses with `left`.\npublic func <^ <C: Collection, T, U> (left: T, right: @escaping Parser<C, U>.Function) -> Parser<C, T>.Function {\n\treturn { (_: U) -> T in left } <^> right\n}\n\n/// Curried `<^>`. Returns a parser which applies `f` to transform the output of `parser`.\npublic func map<C: Collection, T, U>(_ f: @escaping (T) -> U) -> (@escaping Parser<C, T>.Function) -> Parser<C, U>.Function {\n\treturn { f <^> $0 }\n}\n\n\n// MARK: - pure\n\n/// Returns a parser which always ignores its input and produces a constant value.\n///\n/// When combining parsers with `>>-`, allows constant values to be injected into the parser chain.\npublic func pure<C: Collection, T>(_ value: T) -> Parser<C, T>.Function {\n\treturn { _, index in .success((value, index)) }\n}\n\n\n// MARK: - lift\n\npublic func lift<C: Collection, T, U, V>(_ f: @escaping (T, U) -> V) -> Parser<C, (T) -> (U) -> V>.Function {\n\treturn pure({ t in { u in f(t, u) } })\n}\n\npublic func lift<C: Collection, T, U, V, W>(_ f: @escaping (T, U, V) -> W) -> Parser<C, (T) -> (U) -> (V) -> W>.Function {\n\treturn pure({ t in { u in { v in f(t, u, v) } } })\n}\n\n\n// MARK: - pair\n\npublic func pair<A, B>(_ a: A, b: B) -> (A, B) {\n\treturn (a, b)\n}\n\n\n// MARK: - Operators\n\n/// Flat map operator.\ninfix operator >>- : ChainingPrecedence\n\n/// Map operator.\ninfix operator <^> : ConcatenationPrecedence\n\n/// Replace operator.\ninfix operator <^ : ConcatenationPrecedence\n\n\nimport Result\n"
  },
  {
    "path": "Madness/Negation.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\n/// This parser succeeds iff `parser` fails. This parser does not consume any input.\npublic func not<C: Collection, T> (_ parser: @escaping Parser<C, T>.Function) -> Parser<C, ()>.Function {\n\treturn { input, index in\n\t\treturn parser(input, index).analysis(\n\t\t\tifSuccess: { (_, endIndex) in\n\t\t\t\tResult.failure(Error.leaf(\"failed negative lookahead ending at \\(endIndex)\", index))\n\t\t\t},\n\t\t\tifFailure: { _ in Result.success(((), index)) }\n\t\t)\n\t}\n}\n\n// MARK: - Imports\n\nimport Result\n"
  },
  {
    "path": "Madness/Parser.swift",
    "content": "//  Copyright (c) 2014 Rob Rix. All rights reserved.\n\n// Swift has no way to resolve to `Result.Result` inside `Parser.Result`.\npublic typealias ParserResult<C: Collection, Tree> = Result<(Tree, SourcePos<C.Index>), Error<C.Index>>\n\n/// Convenience for describing the types of parser combinators.\n///\n/// \\param Tree  The type of parse tree generated by the parser.\npublic enum Parser<C: Collection, Tree> {\n\t/// The type of parser combinators.\n\tpublic typealias Function = (C, SourcePos<C.Index>) -> Result\n\n\t/// The type produced by parser combinators.\n\tpublic typealias Result = ParserResult<C, Tree>\n}\n\n/// Parses `input` with `parser`, returning the parse trees or `nil` if nothing could be parsed, or if parsing did not consume the entire input.\npublic func parse<C: Collection, Tree>(_ parser: Parser<C, Tree>.Function, input: C) -> Result<Tree, Error<C.Index>> {\n\tlet result = parser(input, SourcePos(index: input.startIndex))\n\t\n\treturn result.flatMap { tree, sourcePos in\n\t\treturn sourcePos.index == input.endIndex\n\t\t\t? .success(tree)\n\t\t\t: .failure(.leaf(\"finished parsing before end of input\", sourcePos))\n\t}\n}\n\npublic func parse<Tree>(_ parser: Parser<String.CharacterView, Tree>.Function, input: String) -> Result<Tree, Error<String.Index>> {\n\treturn parse(parser, input: input.characters)\n}\n\n// MARK: - Terminals\n\n/// Returns a parser which never parses its input.\npublic func none<C: Collection, Tree>(_ string: String = \"no way forward\") -> Parser<C, Tree>.Function {\n\treturn { _, sourcePos in .failure(.leaf(string, sourcePos)) }\n}\n\n// Returns a parser which parses any single character.\npublic func any<C: Collection>(_ input: C, sourcePos: SourcePos<C.Index>) -> Parser<C, C.Element>.Result {\n\treturn satisfy { _ in true }(input, sourcePos)\n}\n\npublic func any(_ input: String.CharacterView, sourcePos: SourcePos<String.Index>) -> Parser<String.CharacterView, Character>.Result {\n\treturn satisfy { _ in true }(input, sourcePos)\n}\n\n\n/// Returns a parser which parses a `literal` sequence of elements from the input.\n///\n/// This overload enables e.g. `%\"xyz\"` to produce `String -> (String, String)`.\npublic prefix func % <C: Collection> (literal: C) -> Parser<C, C>.Function where C.Element: Equatable {\n\treturn { input, sourcePos in\n\t\tif input[sourcePos.index...].starts(with: literal) {\n\t\t\treturn .success((literal, sourcePos.advanced(by: literal.count, from: input)))\n\t\t} else {\n\t\t\treturn .failure(.leaf(\"expected \\(literal)\", sourcePos))\n\t\t}\n\t}\n}\n\npublic prefix func %(literal: String) -> Parser<String.CharacterView, String>.Function {\n\treturn { input, sourcePos in\n\t\tif input[sourcePos.index...].starts(with: literal.characters) {\n\t\t\treturn .success((literal, sourcePos.advanced(by: literal, from: input)))\n\t\t} else {\n\t\t\treturn .failure(.leaf(\"expected \\(literal)\", sourcePos))\n\t\t}\n\t}\n}\n\n/// Returns a parser which parses a `literal` element from the input.\npublic prefix func % <C: Collection> (literal: C.Element) -> Parser<C, C.Element>.Function where C.Element: Equatable {\n\treturn { input, sourcePos in\n\t\tif sourcePos.index != input.endIndex && input[sourcePos.index] == literal {\n\t\t\treturn .success((literal, sourcePos.advanced(by: 1, from: input)))\n\t\t} else {\n\t\t\treturn .failure(.leaf(\"expected \\(literal)\", sourcePos))\n\t\t}\n\t}\n}\n\n\n/// Returns a parser which parses any character in `range`.\npublic prefix func %(range: ClosedRange<Character>) -> Parser<String.CharacterView, String>.Function {\n\treturn { (input: String.CharacterView, sourcePos: SourcePos<String.Index>) in\n\t\tlet index = sourcePos.index\n\t\t\n\t\tif index < input.endIndex && range.contains(input[index]) {\n\t\t\tlet string = String(input[index])\n\t\t\treturn .success((string, sourcePos.advanced(by: 1, from: input)))\n\t\t} else {\n\t\t\treturn .failure(.leaf(\"expected an element in range \\(range)\", sourcePos))\n\t\t}\n\t}\n}\n\n\n// MARK: - Nonterminals\n\nprivate func memoize<T>(_ f: @escaping () -> T) -> () -> T {\n\tvar memoized: T!\n\treturn {\n\t\tif memoized == nil {\n\t\t\tmemoized = f()\n\t\t}\n\t\treturn memoized\n\t}\n}\n\npublic func delay<C: Collection, T>(_ parser: @escaping () -> Parser<C, T>.Function) -> Parser<C, T>.Function {\n\tlet memoized = memoize(parser)\n\treturn { memoized()($0, $1) }\n}\n\n// Returns a parser that satisfies the given predicate\npublic func satisfy(_ pred: @escaping (Character) -> Bool) -> Parser<String.CharacterView, Character>.Function {\n\treturn tokenPrim(pred) { $0.advanced(by: $1, from: $2) }\n}\n\n// Returns a parser that satisfies the given predicate\npublic func satisfy<C: Collection> (_ pred: @escaping (C.Element) -> Bool) -> Parser<C, C.Element>.Function {\n\treturn tokenPrim(pred) { $0.advanced(by: 1, from: $2) }\n}\n\npublic func tokenPrim<C: Collection> (_ pred: @escaping (C.Element) -> Bool, _ nextPos: @escaping (SourcePos<C.Index>, C.Element, C) -> SourcePos<C.Index>) -> Parser<C, C.Element>.Function {\n\treturn { input, sourcePos in\n\t\tlet index = sourcePos.index\n\t\tif index != input.endIndex {\n\t\t\tlet parsed = input[index]\n\t\t\t\n\t\t\tif pred(parsed) {\n\t\t\t\treturn .success((parsed, nextPos(sourcePos, parsed, input)))\n\t\t\t} else {\n\t\t\t\treturn .failure(Error.leaf(\"Failed to parse \\(String(describing: parsed)) with predicate at index\", sourcePos))\n\t\t\t}\n\t\t} else {\n\t\t\treturn .failure(Error.leaf(\"Failed to parse at end of input\", sourcePos))\n\t\t}\n\t}\n}\n\n\n// MARK: - Operators\n\n/// Map operator.\ninfix operator --> : ChainingPrecedence\n\n\n/// Literal operator.\nprefix operator %\n\n\n// MARK: - Imports\n\nimport Result\n"
  },
  {
    "path": "Madness/Reduction.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\n/// Returns a parser which maps parse trees into another type.\npublic func --> <C: Collection, T, U>(parser: @escaping Parser<C, T>.Function, f: @escaping (C, CountableClosedRange<Line>, CountableClosedRange<Column>, Range<C.Index>, T) -> U) -> Parser<C, U>.Function {\n\treturn { input, inputPos in\n\t\treturn parser(input, inputPos).map { output, outputPos in\n\t\t\t(f(input, inputPos.line...outputPos.line, outputPos.column...outputPos.column, inputPos.index..<outputPos.index, output), outputPos)\n\t\t}\n\t}\n}\n\n/// Returns a parser which maps parse results.\n///\n/// This enables e.g. adding identifiers for error handling.\npublic func --> <C: Collection, T, U> (parser: @escaping Parser<C, T>.Function, transform: @escaping (Parser<C, T>.Result) -> Parser<C, U>.Result) -> Parser<C, U>.Function {\n\treturn {  transform(parser($0, $1)) }\n}\n"
  },
  {
    "path": "Madness/Repetition.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\n/// Parser `parser` 1 or more times.\npublic func some<C: Collection, T> (_ parser: @escaping Parser<C, T>.Function) -> Parser<C, [T]>.Function {\n\treturn prepend <^> require(parser) <*> many(parser)\n}\n\n/// Parses 1 or more `parser` separated by `separator`.\npublic func sepBy1<C: Collection, T, U>(_ parser: @escaping Parser<C, T>.Function, _ separator: @escaping Parser<C, U>.Function) -> Parser<C, [T]>.Function {\n\treturn prepend <^> parser <*> many(separator *> parser)\n}\n\n/// Parses 0 or more `parser` separated by `separator`.\npublic func sepBy<C: Collection, T, U>(_ parser: @escaping Parser<C, T>.Function, _ separator: @escaping Parser<C, U>.Function) -> Parser<C, [T]>.Function {\n\treturn sepBy1(parser, separator) <|> pure([])\n}\n\n/// Parses 1 or more `parser` ended by `terminator`.\npublic func endBy1<C: Collection, T, U>(_ parser: @escaping Parser<C, T>.Function, _ terminator: @escaping Parser<C, U>.Function) -> Parser<C, [T]>.Function {\n\treturn some(parser <* terminator)\n}\n\n/// Parses 0 or more `parser` ended by `terminator`.\npublic func endBy<C: Collection, T, U>(_ parser: @escaping Parser<C, T>.Function, _ terminator: @escaping Parser<C, U>.Function) -> Parser<C, [T]>.Function {\n\treturn many(parser <* terminator)\n}\n\n/// Parses `parser` the number of times specified in `interval`.\n///\n/// \\param interval  An interval specifying the number of repetitions to perform. `0...n` means at most `n` repetitions; `m...Int.max` means at least `m` repetitions; and `m...n` means between `m` and `n` repetitions (inclusive).\npublic func * <C: Collection, T> (parser: @escaping Parser<C, T>.Function, interval: CountableClosedRange<Int>) -> Parser<C, [T]>.Function {\n\tif interval.upperBound <= 0 { return { .success(([], $1)) } }\n\n\treturn (parser >>- { x in { [x] + $0 } <^> (parser * decrement(interval)) })\n\t\t<|> { interval.lowerBound <= 0 ? .success(([], $1)) : .failure(.leaf(\"expected at least \\(interval.lowerBound) matches\", $1)) }\n}\n\n/// Parses `parser` exactly `n` times.\t\t\n///\n/// `n` must be > 0 to make any sense.\npublic func * <C: Collection, T> (parser: @escaping Parser<C, T>.Function, n: Int) -> Parser<C, [T]>.Function {\n\treturn ntimes(parser, n)\n}\n\n/// Parses `parser` the number of times specified in `interval`.\n///\n/// \\param interval  An interval specifying the number of repetitions to perform. `0..<n` means at most `n-1` repetitions; `m..<Int.max` means at least `m` repetitions; and `m..<n` means at least `m` and fewer than `n` repetitions; `n..<n` is an error.\npublic func * <C: Collection, T> (parser: @escaping Parser<C, T>.Function, interval: Range<Int>) -> Parser<C, [T]>.Function {\n\tif interval.isEmpty { return { .failure(.leaf(\"cannot parse an empty interval of repetitions\", $1)) } }\n\treturn parser * (interval.lowerBound...decrement(interval.upperBound))\n}\n\n/// Parses `parser` 0 or more times.\npublic func many<C: Collection, T> (_ p: @escaping Parser<C, T>.Function) -> Parser<C, [T]>.Function {\n\treturn prepend <^> require(p) <*> delay { many(p) } <|> pure([])\n}\n\n/// Parses `parser` `n` number of times.\npublic func ntimes<C: Collection, T> (_ p: @escaping Parser<C, T>.Function, _ n: Int) -> Parser<C, [T]>.Function {\n\tguard n > 0 else { return pure([]) }\n\treturn prepend <^> p <*> delay { ntimes(p, n - 1) }\n}\n\n\n// MARK: - Private\n\n/// Decrements `x` iff it is not equal to `Int.max`.\nprivate func decrement(_ x: Int) -> Int {\n\treturn (x == Int.max ? Int.max : x - 1)\n}\n\nprivate func decrement(_ x: CountableClosedRange<Int>) -> CountableClosedRange<Int> {\n\treturn decrement(x.lowerBound)...decrement(x.upperBound)\n}\n\n/// Fails iff `parser` does not consume input, otherwise pass through its results\nprivate func require<C: Collection, T> (_ parser: @escaping Parser<C,T>.Function) -> Parser<C, T>.Function {\n\treturn { (input, sourcePos) in\n\t\treturn parser(input, sourcePos).flatMap { resultInput, resultPos in\n\t\t\tif sourcePos.index == resultPos.index {\n\t\t\t\treturn Result.failure(Error.leaf(\"parser did not consume input when required\", sourcePos))\n\t\t\t}\n\t\t\treturn Result.success((resultInput, resultPos))\n\t\t}\n\t}\n}\n\n\n// MARK: - Imports\n\nimport Result\n"
  },
  {
    "path": "Madness/SourcePos.swift",
    "content": "//  Copyright (c) 2014 Josh Vera. All rights reserved.\n\npublic typealias Line = Int\npublic typealias Column = Int\n\nvar DefaultTabWidth = 8\n\npublic struct SourcePos<Index: Comparable> {\n\tpublic let line: Line\n\tpublic let column: Column\n\tpublic let index: Index\n\t\n\tpublic init(index: Index) {\n\t\tline = 1\n\t\tcolumn = 1\n\t\tself.index = index\n\t}\n\t\n\tpublic init(line: Line, column: Column, index: Index) {\n\t\tself.line = line\n\t\tself.column = column\n\t\tself.index = index\n\t}\n\n}\n\nextension SourcePos: Equatable {\n\t/// Returns whether two SourcePos are equal.\n\tpublic static func ==(first: SourcePos, other: SourcePos) -> Bool {\n\t\treturn first.line == other.line && first.column == other.column && first.index == other.index\n\t}\n}\n\nextension SourcePos {\n\t/// Returns a new SourcePos advanced by the given index.\n\tpublic func advanced(to index: Index) -> SourcePos {\n\t\treturn SourcePos(line: line, column: column, index: index)\n\t}\n\t\n\t/// Returns a new SourcePos advanced by `count`.\n\tpublic func advanced<C: Collection>(by distance: C.IndexDistance, from input: C) -> SourcePos where C.Index == Index {\n\t\treturn advanced(to: input.index(index, offsetBy: distance))\n\t}\n}\n\nextension SourcePos where Index == String.Index {\n\t/// Returns a new SourcePos with its line, column, and index advanced by the given character.\n\tpublic func advanced(by char: Character, from input: String.CharacterView) -> SourcePos {\n\t\tlet nextIndex = input.index(after: index)\n\t\tif char == \"\\n\" {\n\t\t\treturn SourcePos(line: line + 1, column: 0, index: nextIndex)\n\t\t} else if char == \"\\t\" {\n\t\t\treturn SourcePos(line: line, column: column + DefaultTabWidth - ((column - 1) % DefaultTabWidth), index: nextIndex)\n\t\t} else {\n\t\t\treturn SourcePos(line: line, column: column + 1, index: nextIndex)\n\t\t}\n\t}\n\n\t/// Returns a new SourcePos with its line, column, and index advanced by the given string.\n\tfunc advanced(by string: String, from input: String.CharacterView) -> SourcePos {\n\t\treturn string.characters.reduce(self) { $0.advanced(by: $1, from: input) }\n\t}\n}\n"
  },
  {
    "path": "Madness/String.swift",
    "content": "//\n//  String.swift\n//  Madness\n//\n//  Created by Josh Vera on 10/19/15.\n//  Copyright © 2015 Rob Rix. All rights reserved.\n//\n\nimport Foundation\n\npublic typealias CharacterParser = Parser<String.CharacterView, Character>.Function\npublic typealias CharacterArrayParser = Parser<String.CharacterView, [Character]>.Function\npublic typealias StringParser = Parser<String.CharacterView, String>.Function\npublic typealias DoubleParser = Parser<String.CharacterView, Double>.Function\n\npublic typealias IntParser = Parser<String.CharacterView, Int>.Function\n\nprivate func maybePrepend<T>(_ value: T?) -> ([T]) -> [T] {\n\treturn { value != nil ? [value!] + $0 : $0 }\n}\n\nprivate func concat<T>(_ value: [T]) -> ([T]) -> [T] {\n\treturn { value + $0 }\n}\n\nprivate func concat2<T>(_ value: [T]) -> ([T]) -> ([T]) -> [T] {\n\treturn { value2 in { value + value2 + $0 } }\n}\n\nprivate let someDigits: CharacterArrayParser = some(digit)\n\n// Parses integers as an array of characters\npublic let int: CharacterArrayParser = {\n\tlet minus: Parser<String.CharacterView, Character?>.Function = char(\"-\")|?\n\t\n\treturn maybePrepend <^> minus <*> someDigits\n}()\n\nprivate let decimal: CharacterArrayParser = prepend <^> %\".\" <*> someDigits\n\nprivate let exp: StringParser = %\"e+\" <|> %\"e-\" <|> %\"e\" <|> %\"E+\" <|> %\"E-\" <|> %\"E\"\n\nprivate let exponent: CharacterArrayParser = { s in { s.characters + $0 } } <^> exp <*> someDigits\n\n// Parses floating point numbers as doubles\npublic let number: DoubleParser = { characters in Double(String(characters))! } <^>\n\t((concat2 <^> int <*> decimal <*> exponent)\n\t<|> (concat <^> int <*> decimal)\n\t<|> (concat <^> int <*> exponent)\n\t<|> int)\n\npublic let digit: CharacterParser = oneOf(\"0123456789\")\n\npublic let space: CharacterParser = char(\" \")\n\npublic let newline: CharacterParser = char(\"\\n\")\n\npublic let cr = char(\"\\r\")\n\npublic let crlf: CharacterParser = char(\"\\r\\n\")\n\npublic let endOfLine: CharacterParser = newline <|> crlf\n\npublic let tab: CharacterParser = char(\"\\t\")\n\npublic func oneOf(_ input: String) -> CharacterParser {\n\treturn satisfy { input.characters.contains($0) }\n}\n\npublic func noneOf(_ input: String) -> CharacterParser {\n\treturn satisfy { !input.characters.contains($0) }\n}\n\npublic func char(_ input: Character) -> CharacterParser {\n\treturn satisfy { $0 == input }\n}\n"
  },
  {
    "path": "Madness.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t849DC2381C0F21D0004C1A1E /* Combinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849DC2371C0F21D0004C1A1E /* Combinator.swift */; };\n\t\t849DC2391C0F21D0004C1A1E /* Combinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849DC2371C0F21D0004C1A1E /* Combinator.swift */; };\n\t\t849DC23A1C0F21E1004C1A1E /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1E153551BD5B78E00627E39 /* String.swift */; };\n\t\t849DC23C1C0F224D004C1A1E /* CombinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849DC23B1C0F224D004C1A1E /* CombinatorTests.swift */; };\n\t\t849DC23D1C0F224D004C1A1E /* CombinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849DC23B1C0F224D004C1A1E /* CombinatorTests.swift */; };\n\t\tB8219A941BF1DF05000006F1 /* Negation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8219A931BF1DF05000006F1 /* Negation.swift */; };\n\t\tB8219A951BF1DF0A000006F1 /* Negation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8219A931BF1DF05000006F1 /* Negation.swift */; };\n\t\tB8219A981BF1ED07000006F1 /* NegationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8219A971BF1ED07000006F1 /* NegationTests.swift */; };\n\t\tB88CCA091BF2C17700979677 /* NegationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8219A971BF1ED07000006F1 /* NegationTests.swift */; };\n\t\tB8E0AB871BF098DD002B5C8B /* StringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0AB861BF098DD002B5C8B /* StringTests.swift */; };\n\t\tB8E0AB881BF098DD002B5C8B /* StringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0AB861BF098DD002B5C8B /* StringTests.swift */; };\n\t\tBECD3BD21F8D918E006FF13E /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BECD3BD11F8D918E006FF13E /* Result.framework */; };\n\t\tBECD3BD51F8D91A8006FF13E /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BECD3BD41F8D91A8006FF13E /* Result.framework */; };\n\t\tD1A6B7F91BE01B8F00B4858C /* SourcePos.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A6B7F81BE01B8F00B4858C /* SourcePos.swift */; };\n\t\tD1A6B7FA1BE01B8F00B4858C /* SourcePos.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A6B7F81BE01B8F00B4858C /* SourcePos.swift */; };\n\t\tD1E153561BD5B78E00627E39 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1E153551BD5B78E00627E39 /* String.swift */; };\n\t\tD421A2A91A9A8E33009AC3B1 /* IgnoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D421A2A81A9A8E33009AC3B1 /* IgnoreTests.swift */; };\n\t\tD421A2AA1A9A8E33009AC3B1 /* IgnoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D421A2A81A9A8E33009AC3B1 /* IgnoreTests.swift */; };\n\t\tD421A2AC1A9A9540009AC3B1 /* ReductionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D421A2AB1A9A9540009AC3B1 /* ReductionTests.swift */; };\n\t\tD421A2AD1A9A9540009AC3B1 /* ReductionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D421A2AB1A9A9540009AC3B1 /* ReductionTests.swift */; };\n\t\tD47B10761A9A9A1C006701A8 /* Reduction.swift in Sources */ = {isa = PBXBuildFile; fileRef = D47B10751A9A9A1C006701A8 /* Reduction.swift */; };\n\t\tD47B10771A9A9A1C006701A8 /* Reduction.swift in Sources */ = {isa = PBXBuildFile; fileRef = D47B10751A9A9A1C006701A8 /* Reduction.swift */; };\n\t\tD490927A1A98F11A00275C79 /* CollectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49092791A98F11A00275C79 /* CollectionTests.swift */; };\n\t\tD490927B1A98F11A00275C79 /* CollectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49092791A98F11A00275C79 /* CollectionTests.swift */; };\n\t\tD4BC5E021A98C8B4008C6851 /* Madness.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4BC5DF71A98C8B4008C6851 /* Madness.framework */; };\n\t\tD4BC5E101A98C978008C6851 /* Parser.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4FC47CD1A37E48800D23A6F /* Parser.swift */; };\n\t\tD4BC5E121A98C97C008C6851 /* ParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4FC47C31A37E47C00D23A6F /* ParserTests.swift */; };\n\t\tD4BC5E131A98C97C008C6851 /* MapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C8B02D1A69B1A900943303 /* MapTests.swift */; };\n\t\tD4C0FB011AC5EDA500936032 /* Fixtures.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C0FAFE1AC5ECCE00936032 /* Fixtures.swift */; };\n\t\tD4C0FB021AC5EDA600936032 /* Fixtures.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C0FAFE1AC5ECCE00936032 /* Fixtures.swift */; };\n\t\tD4C2EDA71A98D38E00054FAA /* Concatenation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDA61A98D38E00054FAA /* Concatenation.swift */; };\n\t\tD4C2EDAA1A98D4D400054FAA /* ConcatenationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDA81A98D49500054FAA /* ConcatenationTests.swift */; };\n\t\tD4C2EDAB1A98D4D600054FAA /* ConcatenationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDA81A98D49500054FAA /* ConcatenationTests.swift */; };\n\t\tD4C2EDAC1A98D4DE00054FAA /* Concatenation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDA61A98D38E00054FAA /* Concatenation.swift */; };\n\t\tD4C2EDAE1A98D52B00054FAA /* Alternation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDAD1A98D52B00054FAA /* Alternation.swift */; };\n\t\tD4C2EDAF1A98D53400054FAA /* Alternation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDAD1A98D52B00054FAA /* Alternation.swift */; };\n\t\tD4C2EDB11A98D5DB00054FAA /* AlternationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDB01A98D5DB00054FAA /* AlternationTests.swift */; };\n\t\tD4C2EDB21A98D5DB00054FAA /* AlternationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDB01A98D5DB00054FAA /* AlternationTests.swift */; };\n\t\tD4C2EDB61A98D65300054FAA /* Repetition.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDB31A98D63600054FAA /* Repetition.swift */; };\n\t\tD4C2EDB71A98D65400054FAA /* Repetition.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDB31A98D63600054FAA /* Repetition.swift */; };\n\t\tD4C2EDB91A98D82200054FAA /* RepetitionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDB81A98D82200054FAA /* RepetitionTests.swift */; };\n\t\tD4C2EDBA1A98D82200054FAA /* RepetitionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDB81A98D82200054FAA /* RepetitionTests.swift */; };\n\t\tD4C2EDBC1A98D8F800054FAA /* Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDBB1A98D8F800054FAA /* Map.swift */; };\n\t\tD4C2EDBD1A98D8F800054FAA /* Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C2EDBB1A98D8F800054FAA /* Map.swift */; };\n\t\tD4C2EDFC1A98DEE800054FAA /* Madness.h in Headers */ = {isa = PBXBuildFile; fileRef = D4FC47B61A37E47C00D23A6F /* Madness.h */; settings = {ATTRIBUTES = (Public, ); }; };\n\t\tD4C8B02E1A69B1A900943303 /* MapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C8B02D1A69B1A900943303 /* MapTests.swift */; };\n\t\tD4D328491A9AFE2700216D7E /* ErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D328481A9AFE2700216D7E /* ErrorTests.swift */; };\n\t\tD4D9F28A1A9C42A7002BEFF2 /* ErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D328481A9AFE2700216D7E /* ErrorTests.swift */; };\n\t\tD4DE2EE61ABCB2D000D3D70A /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D3284B1A9AFE6000216D7E /* Error.swift */; };\n\t\tD4DE2EE71ABCB2D100D3D70A /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D3284B1A9AFE6000216D7E /* Error.swift */; };\n\t\tD4FC47B71A37E47C00D23A6F /* Madness.h in Headers */ = {isa = PBXBuildFile; fileRef = D4FC47B61A37E47C00D23A6F /* Madness.h */; settings = {ATTRIBUTES = (Public, ); }; };\n\t\tD4FC47BD1A37E47C00D23A6F /* Madness.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4FC47B11A37E47C00D23A6F /* Madness.framework */; };\n\t\tD4FC47C41A37E47C00D23A6F /* ParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4FC47C31A37E47C00D23A6F /* ParserTests.swift */; };\n\t\tD4FC47CE1A37E48800D23A6F /* Parser.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4FC47CD1A37E48800D23A6F /* Parser.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\tD4BC5E031A98C8B4008C6851 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = D4FC47A81A37E47C00D23A6F /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = D4BC5DF61A98C8B4008C6851;\n\t\t\tremoteInfo = Madness;\n\t\t};\n\t\tD4FC47BE1A37E47C00D23A6F /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = D4FC47A81A37E47C00D23A6F /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = D4FC47B01A37E47C00D23A6F;\n\t\t\tremoteInfo = Madness;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t849DC2371C0F21D0004C1A1E /* Combinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Combinator.swift; sourceTree = \"<group>\"; };\n\t\t849DC23B1C0F224D004C1A1E /* CombinatorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CombinatorTests.swift; sourceTree = \"<group>\"; };\n\t\tB8219A931BF1DF05000006F1 /* Negation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Negation.swift; sourceTree = \"<group>\"; };\n\t\tB8219A971BF1ED07000006F1 /* NegationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NegationTests.swift; sourceTree = \"<group>\"; };\n\t\tB8E0AB861BF098DD002B5C8B /* StringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringTests.swift; sourceTree = \"<group>\"; };\n\t\tBECD3BD11F8D918E006FF13E /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tBECD3BD41F8D91A8006FF13E /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tD1A6B7F81BE01B8F00B4858C /* SourcePos.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SourcePos.swift; sourceTree = \"<group>\"; };\n\t\tD1E153551BD5B78E00627E39 /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = \"<group>\"; };\n\t\tD421A2A81A9A8E33009AC3B1 /* IgnoreTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IgnoreTests.swift; sourceTree = \"<group>\"; };\n\t\tD421A2AB1A9A9540009AC3B1 /* ReductionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ReductionTests.swift; path = MadnessTests/ReductionTests.swift; sourceTree = SOURCE_ROOT; };\n\t\tD47B10751A9A9A1C006701A8 /* Reduction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reduction.swift; sourceTree = \"<group>\"; };\n\t\tD49092791A98F11A00275C79 /* CollectionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionTests.swift; sourceTree = \"<group>\"; };\n\t\tD4BC5DF71A98C8B4008C6851 /* Madness.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Madness.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tD4BC5E011A98C8B4008C6851 /* Madness-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"Madness-iOSTests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tD4C0FAFE1AC5ECCE00936032 /* Fixtures.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Fixtures.swift; sourceTree = \"<group>\"; };\n\t\tD4C2EDA61A98D38E00054FAA /* Concatenation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Concatenation.swift; sourceTree = \"<group>\"; };\n\t\tD4C2EDA81A98D49500054FAA /* ConcatenationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConcatenationTests.swift; sourceTree = \"<group>\"; };\n\t\tD4C2EDAD1A98D52B00054FAA /* Alternation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Alternation.swift; sourceTree = \"<group>\"; };\n\t\tD4C2EDB01A98D5DB00054FAA /* AlternationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlternationTests.swift; sourceTree = \"<group>\"; };\n\t\tD4C2EDB31A98D63600054FAA /* Repetition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Repetition.swift; sourceTree = \"<group>\"; };\n\t\tD4C2EDB81A98D82200054FAA /* RepetitionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RepetitionTests.swift; sourceTree = \"<group>\"; };\n\t\tD4C2EDBB1A98D8F800054FAA /* Map.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Map.swift; sourceTree = \"<group>\"; };\n\t\tD4C8B02D1A69B1A900943303 /* MapTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapTests.swift; sourceTree = \"<group>\"; };\n\t\tD4D328481A9AFE2700216D7E /* ErrorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ErrorTests.swift; sourceTree = \"<group>\"; };\n\t\tD4D3284B1A9AFE6000216D7E /* Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = \"<group>\"; };\n\t\tD4FC47B11A37E47C00D23A6F /* Madness.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Madness.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tD4FC47B51A37E47C00D23A6F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\tD4FC47B61A37E47C00D23A6F /* Madness.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Madness.h; sourceTree = \"<group>\"; };\n\t\tD4FC47BC1A37E47C00D23A6F /* Madness-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"Madness-MacTests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tD4FC47C21A37E47C00D23A6F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\tD4FC47C31A37E47C00D23A6F /* ParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParserTests.swift; sourceTree = \"<group>\"; };\n\t\tD4FC47CD1A37E48800D23A6F /* Parser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tD4BC5DF31A98C8B4008C6851 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tBECD3BD51F8D91A8006FF13E /* Result.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4BC5DFE1A98C8B4008C6851 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD4BC5E021A98C8B4008C6851 /* Madness.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4FC47AD1A37E47C00D23A6F /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tBECD3BD21F8D918E006FF13E /* Result.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4FC47B91A37E47C00D23A6F /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD4FC47BD1A37E47C00D23A6F /* Madness.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tBECD3BD31F8D9199006FF13E /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tBECD3BD41F8D91A8006FF13E /* Result.framework */,\n\t\t\t\tBECD3BD11F8D918E006FF13E /* Result.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD4FC47A71A37E47C00D23A6F = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4FC47B31A37E47C00D23A6F /* Madness */,\n\t\t\t\tD4FC47C01A37E47C00D23A6F /* MadnessTests */,\n\t\t\t\tBECD3BD31F8D9199006FF13E /* Frameworks */,\n\t\t\t\tD4FC47B21A37E47C00D23A6F /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t\tusesTabs = 1;\n\t\t};\n\t\tD4FC47B21A37E47C00D23A6F /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4FC47B11A37E47C00D23A6F /* Madness.framework */,\n\t\t\t\tD4FC47BC1A37E47C00D23A6F /* Madness-MacTests.xctest */,\n\t\t\t\tD4BC5DF71A98C8B4008C6851 /* Madness.framework */,\n\t\t\t\tD4BC5E011A98C8B4008C6851 /* Madness-iOSTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD4FC47B31A37E47C00D23A6F /* Madness */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4FC47B61A37E47C00D23A6F /* Madness.h */,\n\t\t\t\tD4FC47CD1A37E48800D23A6F /* Parser.swift */,\n\t\t\t\tD1A6B7F81BE01B8F00B4858C /* SourcePos.swift */,\n\t\t\t\tD4C2EDAD1A98D52B00054FAA /* Alternation.swift */,\n\t\t\t\tD4C2EDA61A98D38E00054FAA /* Concatenation.swift */,\n\t\t\t\tD4D3284B1A9AFE6000216D7E /* Error.swift */,\n\t\t\t\tD4C2EDBB1A98D8F800054FAA /* Map.swift */,\n\t\t\t\tB8219A931BF1DF05000006F1 /* Negation.swift */,\n\t\t\t\tD47B10751A9A9A1C006701A8 /* Reduction.swift */,\n\t\t\t\tD4C2EDB31A98D63600054FAA /* Repetition.swift */,\n\t\t\t\t849DC2371C0F21D0004C1A1E /* Combinator.swift */,\n\t\t\t\tD4FC47B41A37E47C00D23A6F /* Supporting Files */,\n\t\t\t\tD1E153551BD5B78E00627E39 /* String.swift */,\n\t\t\t);\n\t\t\tpath = Madness;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD4FC47B41A37E47C00D23A6F /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4FC47B51A37E47C00D23A6F /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD4FC47C01A37E47C00D23A6F /* MadnessTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4FC47C31A37E47C00D23A6F /* ParserTests.swift */,\n\t\t\t\tD4C2EDB01A98D5DB00054FAA /* AlternationTests.swift */,\n\t\t\t\tD49092791A98F11A00275C79 /* CollectionTests.swift */,\n\t\t\t\tD4C2EDA81A98D49500054FAA /* ConcatenationTests.swift */,\n\t\t\t\t849DC23B1C0F224D004C1A1E /* CombinatorTests.swift */,\n\t\t\t\tD4D328481A9AFE2700216D7E /* ErrorTests.swift */,\n\t\t\t\tD4C8B02D1A69B1A900943303 /* MapTests.swift */,\n\t\t\t\tB8219A971BF1ED07000006F1 /* NegationTests.swift */,\n\t\t\t\tD421A2A81A9A8E33009AC3B1 /* IgnoreTests.swift */,\n\t\t\t\tD421A2AB1A9A9540009AC3B1 /* ReductionTests.swift */,\n\t\t\t\tD4C2EDB81A98D82200054FAA /* RepetitionTests.swift */,\n\t\t\t\tB8E0AB861BF098DD002B5C8B /* StringTests.swift */,\n\t\t\t\tD4C0FAFE1AC5ECCE00936032 /* Fixtures.swift */,\n\t\t\t\tD4FC47C11A37E47C00D23A6F /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = MadnessTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tD4FC47C11A37E47C00D23A6F /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD4FC47C21A37E47C00D23A6F /* Info.plist */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\tD4BC5DF41A98C8B4008C6851 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD4C2EDFC1A98DEE800054FAA /* Madness.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4FC47AE1A37E47C00D23A6F /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD4FC47B71A37E47C00D23A6F /* Madness.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\tD4BC5DF61A98C8B4008C6851 /* Madness-iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = D4BC5E0A1A98C8B4008C6851 /* Build configuration list for PBXNativeTarget \"Madness-iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tD4BC5DF21A98C8B4008C6851 /* Sources */,\n\t\t\t\tD4BC5DF31A98C8B4008C6851 /* Frameworks */,\n\t\t\t\tD4BC5DF41A98C8B4008C6851 /* Headers */,\n\t\t\t\tD4BC5DF51A98C8B4008C6851 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"Madness-iOS\";\n\t\t\tproductName = Madness;\n\t\t\tproductReference = D4BC5DF71A98C8B4008C6851 /* Madness.framework */;\n\t\t\tproductType = \"com.apple.product-type.framework\";\n\t\t};\n\t\tD4BC5E001A98C8B4008C6851 /* Madness-iOSTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = D4BC5E0D1A98C8B4008C6851 /* Build configuration list for PBXNativeTarget \"Madness-iOSTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tD4BC5DFD1A98C8B4008C6851 /* Sources */,\n\t\t\t\tD4BC5DFE1A98C8B4008C6851 /* Frameworks */,\n\t\t\t\tD4BC5DFF1A98C8B4008C6851 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tD4BC5E041A98C8B4008C6851 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Madness-iOSTests\";\n\t\t\tproductName = MadnessTests;\n\t\t\tproductReference = D4BC5E011A98C8B4008C6851 /* Madness-iOSTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\tD4FC47B01A37E47C00D23A6F /* Madness-Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = D4FC47C71A37E47C00D23A6F /* Build configuration list for PBXNativeTarget \"Madness-Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tD4FC47AC1A37E47C00D23A6F /* Sources */,\n\t\t\t\tD4FC47AD1A37E47C00D23A6F /* Frameworks */,\n\t\t\t\tD4FC47AE1A37E47C00D23A6F /* Headers */,\n\t\t\t\tD4FC47AF1A37E47C00D23A6F /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"Madness-Mac\";\n\t\t\tproductName = Madness;\n\t\t\tproductReference = D4FC47B11A37E47C00D23A6F /* Madness.framework */;\n\t\t\tproductType = \"com.apple.product-type.framework\";\n\t\t};\n\t\tD4FC47BB1A37E47C00D23A6F /* Madness-MacTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = D4FC47CA1A37E47C00D23A6F /* Build configuration list for PBXNativeTarget \"Madness-MacTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tD4FC47B81A37E47C00D23A6F /* Sources */,\n\t\t\t\tD4FC47B91A37E47C00D23A6F /* Frameworks */,\n\t\t\t\tD4FC47BA1A37E47C00D23A6F /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tD4FC47BF1A37E47C00D23A6F /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Madness-MacTests\";\n\t\t\tproductName = MadnessTests;\n\t\t\tproductReference = D4FC47BC1A37E47C00D23A6F /* Madness-MacTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tD4FC47A81A37E47C00D23A6F /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 0700;\n\t\t\t\tLastUpgradeCheck = 0900;\n\t\t\t\tORGANIZATIONNAME = \"Rob Rix\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\tD4BC5DF61A98C8B4008C6851 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.3;\n\t\t\t\t\t};\n\t\t\t\t\tD4BC5E001A98C8B4008C6851 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.3;\n\t\t\t\t\t};\n\t\t\t\t\tD4FC47B01A37E47C00D23A6F = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t\tLastSwiftMigration = 0900;\n\t\t\t\t\t};\n\t\t\t\t\tD4FC47BB1A37E47C00D23A6F = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t\tLastSwiftMigration = 0900;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = D4FC47AB1A37E47C00D23A6F /* Build configuration list for PBXProject \"Madness\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = D4FC47A71A37E47C00D23A6F;\n\t\t\tproductRefGroup = D4FC47B21A37E47C00D23A6F /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tD4FC47B01A37E47C00D23A6F /* Madness-Mac */,\n\t\t\t\tD4FC47BB1A37E47C00D23A6F /* Madness-MacTests */,\n\t\t\t\tD4BC5DF61A98C8B4008C6851 /* Madness-iOS */,\n\t\t\t\tD4BC5E001A98C8B4008C6851 /* Madness-iOSTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\tD4BC5DF51A98C8B4008C6851 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4BC5DFF1A98C8B4008C6851 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4FC47AF1A37E47C00D23A6F /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4FC47BA1A37E47C00D23A6F /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tD4BC5DF21A98C8B4008C6851 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t849DC23A1C0F21E1004C1A1E /* String.swift in Sources */,\n\t\t\t\tD4DE2EE71ABCB2D100D3D70A /* Error.swift in Sources */,\n\t\t\t\t849DC2391C0F21D0004C1A1E /* Combinator.swift in Sources */,\n\t\t\t\tD4C2EDAF1A98D53400054FAA /* Alternation.swift in Sources */,\n\t\t\t\tD4BC5E101A98C978008C6851 /* Parser.swift in Sources */,\n\t\t\t\tD4C2EDBD1A98D8F800054FAA /* Map.swift in Sources */,\n\t\t\t\tD4C2EDAC1A98D4DE00054FAA /* Concatenation.swift in Sources */,\n\t\t\t\tD1A6B7FA1BE01B8F00B4858C /* SourcePos.swift in Sources */,\n\t\t\t\tD47B10771A9A9A1C006701A8 /* Reduction.swift in Sources */,\n\t\t\t\tB8219A951BF1DF0A000006F1 /* Negation.swift in Sources */,\n\t\t\t\tD4C2EDB61A98D65300054FAA /* Repetition.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4BC5DFD1A98C8B4008C6851 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD4C2EDAB1A98D4D600054FAA /* ConcatenationTests.swift in Sources */,\n\t\t\t\tD4C2EDBA1A98D82200054FAA /* RepetitionTests.swift in Sources */,\n\t\t\t\t849DC23D1C0F224D004C1A1E /* CombinatorTests.swift in Sources */,\n\t\t\t\tD490927B1A98F11A00275C79 /* CollectionTests.swift in Sources */,\n\t\t\t\tD4C0FB011AC5EDA500936032 /* Fixtures.swift in Sources */,\n\t\t\t\tB8E0AB881BF098DD002B5C8B /* StringTests.swift in Sources */,\n\t\t\t\tD4BC5E131A98C97C008C6851 /* MapTests.swift in Sources */,\n\t\t\t\tB88CCA091BF2C17700979677 /* NegationTests.swift in Sources */,\n\t\t\t\tD4BC5E121A98C97C008C6851 /* ParserTests.swift in Sources */,\n\t\t\t\tD4C2EDB21A98D5DB00054FAA /* AlternationTests.swift in Sources */,\n\t\t\t\tD421A2AA1A9A8E33009AC3B1 /* IgnoreTests.swift in Sources */,\n\t\t\t\tD4D9F28A1A9C42A7002BEFF2 /* ErrorTests.swift in Sources */,\n\t\t\t\tD421A2AD1A9A9540009AC3B1 /* ReductionTests.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4FC47AC1A37E47C00D23A6F /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD4DE2EE61ABCB2D000D3D70A /* Error.swift in Sources */,\n\t\t\t\tD4C2EDAE1A98D52B00054FAA /* Alternation.swift in Sources */,\n\t\t\t\tD4FC47CE1A37E48800D23A6F /* Parser.swift in Sources */,\n\t\t\t\tB8219A941BF1DF05000006F1 /* Negation.swift in Sources */,\n\t\t\t\tD4C2EDBC1A98D8F800054FAA /* Map.swift in Sources */,\n\t\t\t\tD4C2EDA71A98D38E00054FAA /* Concatenation.swift in Sources */,\n\t\t\t\tD1A6B7F91BE01B8F00B4858C /* SourcePos.swift in Sources */,\n\t\t\t\t849DC2381C0F21D0004C1A1E /* Combinator.swift in Sources */,\n\t\t\t\tD47B10761A9A9A1C006701A8 /* Reduction.swift in Sources */,\n\t\t\t\tD1E153561BD5B78E00627E39 /* String.swift in Sources */,\n\t\t\t\tD4C2EDB71A98D65400054FAA /* Repetition.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tD4FC47B81A37E47C00D23A6F /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tD4C2EDAA1A98D4D400054FAA /* ConcatenationTests.swift in Sources */,\n\t\t\t\tD4C8B02E1A69B1A900943303 /* MapTests.swift in Sources */,\n\t\t\t\t849DC23C1C0F224D004C1A1E /* CombinatorTests.swift in Sources */,\n\t\t\t\tD490927A1A98F11A00275C79 /* CollectionTests.swift in Sources */,\n\t\t\t\tD4C0FB021AC5EDA600936032 /* Fixtures.swift in Sources */,\n\t\t\t\tB8E0AB871BF098DD002B5C8B /* StringTests.swift in Sources */,\n\t\t\t\tD4C2EDB91A98D82200054FAA /* RepetitionTests.swift in Sources */,\n\t\t\t\tB8219A981BF1ED07000006F1 /* NegationTests.swift in Sources */,\n\t\t\t\tD4FC47C41A37E47C00D23A6F /* ParserTests.swift in Sources */,\n\t\t\t\tD4D328491A9AFE2700216D7E /* ErrorTests.swift in Sources */,\n\t\t\t\tD4C2EDB11A98D5DB00054FAA /* AlternationTests.swift in Sources */,\n\t\t\t\tD421A2A91A9A8E33009AC3B1 /* IgnoreTests.swift in Sources */,\n\t\t\t\tD421A2AC1A9A9540009AC3B1 /* ReductionTests.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\tD4BC5E041A98C8B4008C6851 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = D4BC5DF61A98C8B4008C6851 /* Madness-iOS */;\n\t\t\ttargetProxy = D4BC5E031A98C8B4008C6851 /* PBXContainerItemProxy */;\n\t\t};\n\t\tD4FC47BF1A37E47C00D23A6F /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = D4FC47B01A37E47C00D23A6F /* Madness-Mac */;\n\t\t\ttargetProxy = D4FC47BE1A37E47C00D23A6F /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\tD4BC5E0B1A98C8B4008C6851 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"\";\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = Madness/Info.plist;\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.antitypical.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = Madness;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSWIFT_VERSION = 3.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tD4BC5E0C1A98C8B4008C6851 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINFOPLIST_FILE = Madness/Info.plist;\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.antitypical.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = Madness;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSWIFT_VERSION = 3.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tD4BC5E0E1A98C8B4008C6851 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(SDKROOT)/Developer/Library/Frameworks\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = MadnessTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.antitypical.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_VERSION = 3.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tD4BC5E0F1A98C8B4008C6851 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(SDKROOT)/Developer/Library/Frameworks\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = MadnessTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.antitypical.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_VERSION = 3.0;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tD4FC47C51A37E47C00D23A6F /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.9;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tD4FC47C61A37E47C00D23A6F /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.9;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Owholemodule\";\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tD4FC47C81A37E47C00D23A6F /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tFRAMEWORK_VERSION = A;\n\t\t\t\tINFOPLIST_FILE = Madness/Info.plist;\n\t\t\t\tINSTALL_PATH = \"@rpath\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/../Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.antitypical.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = Madness;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_VERSION = 4.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tD4FC47C91A37E47C00D23A6F /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tFRAMEWORK_VERSION = A;\n\t\t\t\tINFOPLIST_FILE = Madness/Info.plist;\n\t\t\t\tINSTALL_PATH = \"@rpath\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/../Frameworks @loader_path/Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.antitypical.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = Madness;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSWIFT_VERSION = 4.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tD4FC47CB1A37E47C00D23A6F /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(DEVELOPER_FRAMEWORKS_DIR)\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = MadnessTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.antitypical.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 4.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tD4FC47CC1A37E47C00D23A6F /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(DEVELOPER_FRAMEWORKS_DIR)\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = MadnessTests/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks\";\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.antitypical.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 4.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tD4BC5E0A1A98C8B4008C6851 /* Build configuration list for PBXNativeTarget \"Madness-iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tD4BC5E0B1A98C8B4008C6851 /* Debug */,\n\t\t\t\tD4BC5E0C1A98C8B4008C6851 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tD4BC5E0D1A98C8B4008C6851 /* Build configuration list for PBXNativeTarget \"Madness-iOSTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tD4BC5E0E1A98C8B4008C6851 /* Debug */,\n\t\t\t\tD4BC5E0F1A98C8B4008C6851 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tD4FC47AB1A37E47C00D23A6F /* Build configuration list for PBXProject \"Madness\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tD4FC47C51A37E47C00D23A6F /* Debug */,\n\t\t\t\tD4FC47C61A37E47C00D23A6F /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tD4FC47C71A37E47C00D23A6F /* Build configuration list for PBXNativeTarget \"Madness-Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tD4FC47C81A37E47C00D23A6F /* Debug */,\n\t\t\t\tD4FC47C91A37E47C00D23A6F /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tD4FC47CA1A37E47C00D23A6F /* Build configuration list for PBXNativeTarget \"Madness-MacTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tD4FC47CB1A37E47C00D23A6F /* Debug */,\n\t\t\t\tD4FC47CC1A37E47C00D23A6F /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = D4FC47A81A37E47C00D23A6F /* Project object */;\n}\n"
  },
  {
    "path": "Madness.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:Madness.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "Madness.xcodeproj/xcshareddata/xcschemes/Madness-Mac.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0900\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"D4FC47B01A37E47C00D23A6F\"\n               BuildableName = \"Madness.framework\"\n               BlueprintName = \"Madness-Mac\"\n               ReferencedContainer = \"container:Madness.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"NO\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"D4FC47BB1A37E47C00D23A6F\"\n               BuildableName = \"Madness-MacTests.xctest\"\n               BlueprintName = \"Madness-MacTests\"\n               ReferencedContainer = \"container:Madness.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"D4FC47BB1A37E47C00D23A6F\"\n               BuildableName = \"Madness-MacTests.xctest\"\n               BlueprintName = \"Madness-MacTests\"\n               ReferencedContainer = \"container:Madness.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"D4FC47B01A37E47C00D23A6F\"\n            BuildableName = \"Madness.framework\"\n            BlueprintName = \"Madness-Mac\"\n            ReferencedContainer = \"container:Madness.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"D4FC47B01A37E47C00D23A6F\"\n            BuildableName = \"Madness.framework\"\n            BlueprintName = \"Madness-Mac\"\n            ReferencedContainer = \"container:Madness.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"D4FC47B01A37E47C00D23A6F\"\n            BuildableName = \"Madness.framework\"\n            BlueprintName = \"Madness-Mac\"\n            ReferencedContainer = \"container:Madness.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "Madness.xcodeproj/xcshareddata/xcschemes/Madness-iOS.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0900\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"D4BC5DF61A98C8B4008C6851\"\n               BuildableName = \"Madness.framework\"\n               BlueprintName = \"Madness-iOS\"\n               ReferencedContainer = \"container:Madness.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"NO\"\n            buildForProfiling = \"NO\"\n            buildForArchiving = \"NO\"\n            buildForAnalyzing = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"D4BC5E001A98C8B4008C6851\"\n               BuildableName = \"Madness-iOSTests.xctest\"\n               BlueprintName = \"Madness-iOSTests\"\n               ReferencedContainer = \"container:Madness.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"D4BC5E001A98C8B4008C6851\"\n               BuildableName = \"Madness-iOSTests.xctest\"\n               BlueprintName = \"Madness-iOSTests\"\n               ReferencedContainer = \"container:Madness.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"D4BC5DF61A98C8B4008C6851\"\n            BuildableName = \"Madness.framework\"\n            BlueprintName = \"Madness-iOS\"\n            ReferencedContainer = \"container:Madness.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"D4BC5DF61A98C8B4008C6851\"\n            BuildableName = \"Madness.framework\"\n            BlueprintName = \"Madness-iOS\"\n            ReferencedContainer = \"container:Madness.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"D4BC5DF61A98C8B4008C6851\"\n            BuildableName = \"Madness.framework\"\n            BlueprintName = \"Madness-iOS\"\n            ReferencedContainer = \"container:Madness.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "Madness.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <Group\n      location = \"container:Documentation\"\n      name = \"Documentation\">\n      <FileRef\n         location = \"group:Collections.playground\">\n      </FileRef>\n      <FileRef\n         location = \"group:Colours.playground\">\n      </FileRef>\n      <FileRef\n         location = \"group:Lambda Calculus.playground\">\n      </FileRef>\n      <FileRef\n         location = \"group:Subset of Common Markdown.playground\">\n      </FileRef>\n   </Group>\n   <FileRef\n      location = \"group:Carthage/Checkouts/Result/Result.xcodeproj\">\n   </FileRef>\n   <FileRef\n      location = \"group:Madness.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "MadnessTests/AlternationTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nfinal class AlternationTests: XCTestCase {\n\n\t// MARK: Alternation\n\n\tfunc testAlternationParsesEitherAlternative() {\n\t\tassertAdvancedBy(alternation, input: \"xy\".characters, lineOffset: 0, columnOffset: 1, offset: 1)\n\t\tassertAdvancedBy(alternation, input: \"yx\".characters, lineOffset: 0, columnOffset: 1, offset: 1)\n\t}\n\n\tfunc testAlternationOfASingleTypeCoalescesTheParsedValue() {\n\t\tassertTree(alternation, \"xy\".characters, ==, \"x\")\n\n\t}\n\n\n\t// MARK: Optional\n\n\tfunc testOptionalProducesWhenPresent() {\n\t\tassertTree(optional, \"y\".characters, ==, \"y\")\n\t\tassertTree(prefixed, \"xy\".characters, ==, \"xy\")\n\t\tassertTree(suffixed, \"yzsandwiched\".characters, ==, \"yz\")\n\t}\n\n\tfunc testOptionalProducesWhenAbsent() {\n\t\tassertTree(optional, \"\".characters, ==, \"\")\n\t\tassertTree(prefixed, \"x\".characters, ==, \"x\")\n\t\tassertTree(suffixed, \"z\".characters, ==, \"z\")\n\t\tassertTree(sandwiched, \"xz\".characters, ==, \"xz\")\n\t}\n\n\n\t// MARK: One-of\n\n\tfunc testOneOfParsesFirstMatch() {\n\t\tassertTree(one, \"xyz\".characters, ==, \"x\")\n\t\tassertTree(one, \"yzx\".characters, ==, \"y\")\n\t\tassertTree(one, \"zxy\".characters, ==, \"z\")\n\t}\n\n\t// MARK: Any-of\n\n\tfunc testAnyOfParsesAnArrayOfMatchesPreservingOrder() {\n\t\tassertTree(any, \"xy\".characters, ==, [\"x\", \"y\"])\n\t\tassertTree(any, \"yx\".characters, ==, [\"y\", \"x\"])\n\t\tassertTree(any, \"zxy\".characters, ==, [\"z\", \"x\", \"y\"])\n\t}\n\n\tfunc testAnyOfRejectsWhenNoneMatch() {\n\t\t\n\t\tassertUnmatched(anyOf(Set(\"x\")), Set(\"y\".characters))\n\t}\n\n\tfunc testAnyOfOnlyParsesFirstMatch() {\n\t\tassertTree(any, \"xyy\".characters, ==, [\"x\", \"y\"])\n\t}\n\n\n\t// MARK: All-of\n\n\tfunc testAllOfParsesAnArrayOfMatchesPreservingOrder() {\n\t\tassertTree(all, \"xy\".characters, ==, [\"x\", \"y\"])\n\t\tassertTree(all, \"yx\".characters, ==, [\"y\", \"x\"])\n\t\tassertTree(all, \"zxy\".characters, ==, [\"z\", \"x\", \"y\"])\n\t}\n\n\tfunc testAllOfRejectsWhenNoneMatch() {\n\t\tassertUnmatched(allOf(Set(\"x\")), Set([\"y\"]))\n\t}\n}\n\n// MARK: - Fixtures\n\nprivate let alternation = %\"x\" <|> %\"y\"\n\nprivate let optional = map({ $0 ?? \"\" })((%\"y\")|?)\nprivate let prefixed = { x in { y in x + y } } <^> %\"x\" <*> optional\nprivate let suffixed = { x in { y in x + y } } <^> optional <*> %\"z\"\nprivate let sandwiched = { x in { y in x + y } } <^> prefixed <*> %\"z\"\n\nprivate let arrayOfChars: Set<Character> = [\"x\", \"y\", \"z\"]\nprivate let chars: String = \"xyz\"\nprivate let one = oneOf(chars)\nprivate let any: Parser<String.CharacterView, [Character]>.Function  = anyOf(arrayOfChars)\nprivate let all: Parser<String.CharacterView, [Character]>.Function  = allOf(arrayOfChars)\n\n// MARK: - Imports\n\nimport Madness\nimport Result\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/CollectionTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nfinal class CollectionTests: XCTestCase {\n\tfunc testParsingCollections() {\n\t\tlet input = [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]\n\n\t\ttypealias Fibonacci = Parser<[Int], [Int]>.Function\n\n\t\tfunc fibonacci(_ x: Int, _ y: Int) -> Fibonacci {\n\t\t\tlet combined: Fibonacci = %(x + y) >>- { (xy: Int) -> Fibonacci in\n\t\t\t\t{ [ xy ] + $0 } <^> fibonacci(y, xy)\n\t\t\t}\n\t\t\treturn combined <|> pure([])\n\t\t}\n\t\t\n\t\tXCTAssertEqual(parse(fibonacci(0, 1), input: input).value!, input)\n\t}\n}\n\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/CombinatorTests.swift",
    "content": "//  Copyright © 2015 Rob Rix. All rights reserved.\n\nfinal class CombinatorTests: XCTestCase {\n\t\n\t// MARK: - between\n\t\n\tlet braces: (@escaping StringParser) -> StringParser = between(%\"{\", %\"}\")\n\t\n\tfunc testBetweenCombinatorParsesSandwichedString(){\n\t\tassertTree(braces(%\"a\"), \"{a}\".characters, ==, \"a\")\n\t}\n\t\n\tfunc testBetweenCombinatorAcceptsEmptyString(){\n\t\tassertTree(braces(%\"\"), \"{}\".characters, ==, \"\")\n\t}\n\t\n\t// MARK: - manyTill\n\t\n\tlet digits = manyTill(digit, %\",\")\n\t\n\tfunc testManyTillCombinatorParsesElementsUntilEndParser(){\n\t\tassertTree(digits, \"123,\".characters, ==, [\"1\", \"2\", \"3\"])\n\t}\n\t\n\tfunc testManyTillCombinatorAcceptsEmptyString(){\n\t\tassertTree(digits, \",\".characters, ==, [])\n\t}\n\t\n}\n\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/ConcatenationTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nfinal class ConcatenationTests: XCTestCase {\n\tlet concatenation = lift(pair) <*> %\"x\" <*> %\"y\"\n\n\tfunc testConcatenationRejectsPartialParses() {\n\t\tassertUnmatched(concatenation, \"x\".characters)\n\t}\n\n\tfunc testConcatenationParsesBothOperands() {\n\t\tassertAdvancedBy(concatenation, input: \"xyz\".characters, lineOffset: 0, columnOffset: 2, offset: 2)\n\t}\n\n\tfunc testConcatenationProducesPairsOfTerms() {\n\t\tlet input = \"xy\".characters\n\t\tlet parsed = concatenation(input, SourcePos(index: input.startIndex))\n\t\tXCTAssertEqual(parsed.value?.0.0, \"x\")\n\t\tXCTAssertEqual(parsed.value?.0.1, \"y\")\n\t}\n}\n\n\n\nfunc matches<C: Collection, T>(_ parser: Parser<C, T>.Function, input: C) -> Bool {\n\treturn parser(input, SourcePos(index: input.startIndex)).value != nil\n}\n\nfunc doesNotMatch<C: Collection, T>(_ parser: Parser<C, T>.Function, input: C) -> Bool {\n\treturn parser(input, SourcePos(index: input.startIndex)).value == nil\n}\n\nfunc assertUnmatched<C: Collection, T>(_ parser: Parser<C, T>.Function, _ input: C, message: String = \"\", file: StaticString = #file, line: UInt = #line) {\n\tXCTAssertNil(parser(input, SourcePos(index: input.startIndex)).value, \"should not have matched \\(input). \" + message, file: file, line: line)\n}\n\nfunc assertMatched<C: Collection, T>(_ parser: Parser<C, T>.Function, input: C, message: String = \"\", file: StaticString = #file, line: UInt = #line) {\n\tXCTAssertNotNil(parser(input, SourcePos(index: input.startIndex)).value, \"should have matched \\(input). \" + message, file: file, line: line)\n}\n\nfunc assertTree<C: Collection, T>(_ parser: Parser<C, T>.Function, _ input: C, _ match: @escaping (T, T) -> Bool, _ tree: T, message: String = \"\", file: StaticString = #file, line: UInt = #line) {\n\tlet parsed: Parser<C, T>.Result = parser(input, SourcePos(index: input.startIndex))\n\tlet value = parsed.value?.0\n\tXCTAssert(value.map { match($0, tree) } ?? false, \"should have parsed \\(input) as \\(tree). \" + message, file: file, line: line)\n}\n\nfunc assertAdvancedBy<C: Collection, T>(_ parser: Parser<C, T>.Function, input: C, offset: C.IndexDistance, message: String = \"\", file: StaticString = #file, line: UInt = #line) {\n\tlet pos = SourcePos(index: input.startIndex)\n\tlet newSourcePos: SourcePos<C.Index>? = SourcePos(line: pos.line, column: pos.column, index: input.index(pos.index, offsetBy: offset))\n\n\tlet value = parser(input, pos).value\n\tXCTAssertNotNil(value, \"should have parsed \\(input) and advanced by \\(offset). \" + message, file: file, line: line)\n\tXCTAssertEqual(value?.1, newSourcePos, \"should have parsed \\(input) and advanced by \\(offset). \" + message, file: file, line: line)\n}\n\nfunc assertAdvancedBy<C: Collection, T>(_ parser: Parser<C, T>.Function, input: C, lineOffset: Line, columnOffset: Column, offset: C.IndexDistance, message: String = \"\", file: StaticString = #file, line: UInt = #line) {\n\tlet pos = SourcePos(index: input.startIndex)\n\tlet newSourcePos: SourcePos<C.Index>? = SourcePos(line: pos.line + lineOffset, column: pos.column + columnOffset, index: input.index(pos.index, offsetBy: offset))\n\n\tlet value = parser(input, pos).value\n\tXCTAssertNotNil(value, \"should have parsed \\(String(describing: input)) and advanced by \\(offset). \" + message, file: file, line: line)\n\tXCTAssertEqual(value?.1, newSourcePos, \"should have parsed \\(String(describing: input)) and advanced by \\(offset). \" + message, file: file, line: line)\n}\n\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/ErrorTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nfinal class ErrorTests: XCTestCase {\n\tfunc testLiftedParsersDoNotReportErrorsWhenTheyMatch() {\n\t\tlet parser = %\"x\"\n\t\tlet input = \"x\".characters\n\t\tlet sourcePos = SourcePos(index: input.startIndex)\n\t\tXCTAssertNotNil(parser(input, sourcePos).value)\n\t\tXCTAssertNil(parser(input, sourcePos).error)\n\t}\n\n\tfunc testLiftedParsersReportErrorsWhenTheyDoNotMatch() {\n\t\tlet parser = %\"x\"\n\t\tlet input = \"y\"\n\t\tlet sourcePos = SourcePos(index: input.startIndex)\n\t\tXCTAssertNil(parser(input.characters, sourcePos).value)\n\t\tXCTAssertNotNil(parser(input.characters, sourcePos).error)\n\t}\n\n\tfunc testParseError() {\n\t\tXCTAssertEqual(parse(lambda, input: \"λx.\").error?.depth, 5)\n\t}\n\n\tfunc testParseNaming() {\n\t\tXCTAssertNotNil(parse(describeAs(\"lambda\")(lambda), input: \"λx.\").error)\n\t}\n}\n\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/Fixtures.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nextension String {\n\tpublic static func lift<A>(_ parser: @escaping Parser<String.CharacterView, A>.Function) -> Parser<String, A>.Function {\n\t\treturn {\n\t\t\tparser($0.characters, $1)\n\t\t}\n\t}\n}\n\n/// Returns the least fixed point of the function returned by `f`.\n///\n/// This is useful for e.g. making recursive closures without using the two-step assignment dance.\n///\n/// \\param f  - A function which takes a parameter function, and returns a result function. The result function may recur by calling the parameter function.\n///\n/// \\return  A recursive function.\nfunc fix<T, U>(_ f: @escaping (@escaping (T) -> U) -> (T) -> U) -> (T) -> U {\n\treturn { f(fix(f))($0) }\n}\n\ntypealias LambdaParser = Parser<String, Lambda>.Function\n\nfunc lambda(_ input: String, sourcePos: SourcePos<String.Index>) -> Parser<String, Lambda>.Result {\n\tlet symbol: Parser<String, String>.Function = String.lift(%(\"a\"...\"z\"))\n\n\tlet variable: LambdaParser = Lambda.variable <^> symbol\n\tlet abstraction: LambdaParser = { x in { y in Lambda.abstraction(x, y) } } <^> (%\"λ\" *> symbol) <*> (%\".\" *> lambda)\n\tlet application: LambdaParser = { x in { y in Lambda.application(x, y) } } <^> (%\"(\" *> lambda) <*> (%\" \" *> lambda) <* %\")\"\n\tlet parser: LambdaParser = variable <|> abstraction <|> application\n\treturn parser(input, sourcePos)\n}\n\nenum Lambda: CustomStringConvertible {\n\tcase variable(String)\n\tindirect case abstraction(String, Lambda)\n\tindirect case application(Lambda, Lambda)\n\n\tvar description: String {\n\t\tswitch self {\n\t\tcase let .variable(symbol):\n\t\t\treturn symbol\n\t\tcase let .abstraction(symbol, body):\n\t\t\treturn \"λ\\(symbol).\\(body.description)\"\n\t\tcase let .application(x, y):\n\t\t\treturn \"(\\(x.description) \\(y.description))\"\n\t\t}\n\t}\n}\n\n\nimport Madness\n"
  },
  {
    "path": "MadnessTests/IgnoreTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nfinal class IgnoreTests: XCTestCase {\n\tlet ignored = %\"x\"\n\n\tfunc testIgnoredInputDoesNotGetConcatenatedAtLeft() {\n\t\tassertTree(ignored *> %\"y\", \"xy\".characters, ==, \"y\")\n\t}\n\n\tfunc testIgnoredInputDoesNotGetConcatenatedAtRight() {\n\t\tassertTree(%\"y\" <* ignored, \"yx\".characters, ==, \"y\")\n\t}\n\n\tfunc testRepeatedIgnoredEmptyParsesAreDropped() {\n\t\tassertTree(many(ignored) *> %\"y\", \"y\".characters, ==, \"y\")\n\t}\n\n\tfunc testRepeatedIgnoredParsesAreDropped() {\n\t\tassertTree(many(ignored) *> %\"y\", \"xxy\".characters, ==, \"y\")\n\t}\n}\n\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "MadnessTests/MapTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nprivate struct Tree<T: Equatable>: Equatable, CustomStringConvertible {\n\tinit(_ value: T, _ children: [Tree] = []) {\n\t\tself.values = [ value ]\n\t\tself.children = children\n\t}\n\n\tlet values: [T]\n\tlet children: [Tree]\n\n\n\t// MARK: Printable\n\n\tvar description: String {\n\t\tlet space = \" \"\n\t\tlet valueString = values.map({ String(describing: $0) }).joined(separator: space)\n\t\treturn children.count > 0 ?\n\t\t\t\"(\\(valueString) \\(children.map({ String(describing: $0) }).joined(separator: space)))\"\n\t\t:\t\"(\\(valueString))\"\n\t}\n}\n\nprivate func == <T> (left: Tree<T>, right: Tree<T>) -> Bool {\n\treturn left.values == right.values && left.children == right.children\n}\n\nprivate func == <T: Equatable, U: Equatable> (l: (T, U), r: (T, U)) -> Bool {\n\treturn l.0 == r.0 && l.1 == r.1\n}\n\nfinal class MapTests: XCTestCase {\n\n\t// MARK: flatMap\n\n\tfunc testFlatMap() {\n\t\tlet item: Parser<String, String>.Function = %\"-\" *> String.lift(%(\"a\"...\"z\")) <* %\"\\n\"\n\t\tlet tree: (Int) -> Parser<String, Tree<String>>.Function = fix { tree in\n\t\t\t{ n in\n\t\t\t\tlet line: Parser<String, String>.Function = (%\"\\t\" * n) *> item\n\t\t\t\treturn line >>- { itemContent in\n\t\t\t\t\tmap({ children in Tree(itemContent, children) })(many(tree(n + 1)))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet fixtures: [String: Tree<String>] = [\n\t\t\t\"-a\\n\": Tree(\"a\"),\n\t\t\t\"-a\\n\\t-b\\n\": Tree(\"a\", [ Tree(\"b\") ]),\n\t\t\t\"-a\\n\\t-b\\n\\t-c\\n\": Tree(\"a\", [ Tree(\"b\"), Tree(\"c\") ]),\n\t\t\t\"-a\\n\\t-b\\n\\t\\t-c\\n\\t-d\\n\": Tree(\"a\", [ Tree(\"b\", [ Tree(\"c\") ]), Tree(\"d\") ]),\n\t\t]\n\n\t\tfor (input, actual) in fixtures {\n\t\t\tif let parsed = parse(tree(0), input: input).value {\n\t\t\t\tXCTAssertEqual(parsed, actual)\n\t\t\t} else {\n\t\t\t\tXCTFail(\"expected to parse \\(input) as \\(actual) but failed to parse\")\n\t\t\t}\n\t\t}\n\n\t\tlet failures: [String] = [\n\t\t\t\"-a\\n-a\\n\",\n\t\t\t\"-a\\n\\t\\t-b\\n\",\n\t\t\t\"-a\\n\\t-b\\n-c\\n\"\n\t\t]\n\n\t\tfor input in failures {\n\t\t\tXCTAssert(parse(tree(0), input: input).value == nil)\n\t\t}\n\n\t}\n\n\n\t// MARK: map\n\n\tfunc testMapTransformsParserOutput() {\n\t\tassertTree(String.init <^> %123, [123], ==, \"123\")\n\t}\n\n\tfunc testMapHasHigherPrecedenceThanFlatMap() {\n\t\tlet addTwo = { $0 + 2 }\n\t\tlet triple = { $0 * 3 }\n\n\t\tlet parser: Parser<[Int], Int>.Function = addTwo <^> %2 >>- { i in triple <^> pure(i) }\n\n\t\tassertTree(parser, [2], ==, 12)\n\t}\n\n\tfunc testReplaceConsumesItsInput() {\n\t\tassertTree(lift(pair) <*> (\"abc\" <^ %123) <*> %0, [123, 0], ==, (\"abc\", 0))\n\t}\n\n\tfunc testCurriedMap() {\n\t\tassertTree(map({ String($0) })(%123), [123], ==, \"123\")\n\t}\n\n\n\t// MARK: pure\n\n\tfunc testPureIgnoresItsInput() {\n\t\tassertTree(pure(\"a\"), \"b\".characters, ==, \"a\")\n\t}\n}\n\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/NegationTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nclass NegationTests: XCTestCase {\n\tlet notA: CharacterParser = not(%\"a\") *> any\n\n\tfunc testNegativeLookaheadRejectsMatches() {\n\t\tassertUnmatched(notA, \"a\".characters)\n\t}\n\n\tfunc testNegativeLookaheadAcceptsNonMatches() {\n\t\tassertTree(notA, \"b\".characters, ==, \"b\")\n\t}\n\n\n\tlet upToBang: CharacterArrayParser = many(not(%\"!\") *> any) <* many(any)\n\n\tfunc testNegativeLooaheadAccumulation() {\n\t\tassertTree(upToBang, \"xy!z\".characters, ==, [\"x\", \"y\"])\n\t}\n\n\tfunc testNegativeLooaheadAccumulationWithoutMatch() {\n\t\tassertTree(upToBang, \"xyz\".characters, ==, [\"x\", \"y\", \"z\"])\n    }\n}\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/ParserTests.swift",
    "content": "//  Copyright (c) 2014 Rob Rix. All rights reserved.\n\nimport Madness\nimport Result\nimport XCTest\n\nfinal class ParserTests: XCTestCase {\n\t// MARK: - Operations\n\n\tfunc testParseRejectsPartialParses() {\n\t\tXCTAssertNil(parse(%(\"x\".characters), input: \"xy\".characters).value)\n\t}\n\n\tfunc testParseProducesParseTreesForFullParses() {\n\t\tXCTAssertEqual(parse(%\"x\", input: \"x\").value, \"x\")\n\t}\n\n\n\t// MARK: - Terminals\n\n\t// MARK: Literals\n\n\tfunc testLiteralParsersParseAPrefixOfTheInput() {\n\t\tlet parser = %\"foo\"\n\t\tassertAdvancedBy(parser, input: \"foot\".characters, lineOffset: 0, columnOffset: 3, offset: 3)\n\t\tassertUnmatched(parser, \"fo\".characters)\n\t}\n\n\tfunc testLiteralParsersProduceTheirArgument() {\n\t\tassertTree(%\"foo\", \"foot\".characters, ==, \"foo\")\n\t}\n\n\n\t// MARK: Ranges\n\n\tlet digits = %(\"0\"...\"9\")\n\n\tfunc testRangeParsersParseAnyCharacterInTheirRange() {\n\t\tassertTree(digits, \"0\".characters, ==, \"0\")\n\t\tassertTree(digits, \"5\".characters, ==, \"5\")\n\t\tassertTree(digits, \"9\".characters, ==, \"9\")\n\t}\n\n\tfunc testRangeParsersRejectCharactersOutsideTheRange() {\n\t\tassertUnmatched(digits, \"a\".characters)\n\t}\n\n\n\t// MARK: None\n\n\tfunc testNoneDoesNotConsumeItsInput() {\n\t\tassertTree(none() <|> %\"a\", \"a\", ==, \"a\")\n\t}\n\n\tfunc testNoneIsIdentityForAlternation() {\n\t\tlet parser = [%\"a\", %\"b\", %\"c\"].reduce(none(), <|>)\n\t\tassertTree(parser, \"a\".characters, ==, \"a\")\n\t\tassertTree(parser, \"b\".characters, ==, \"b\")\n\t\tassertTree(parser, \"c\".characters, ==, \"c\")\n\t}\n\n\n\t// MARK: Any\n\n\tfunc testAnyRejectsTheEmptyString() {\n\t\tassertUnmatched(any, \"\".characters)\n\t}\n\n\tfunc testAnyParsesAnySingleCharacter() {\n\t\tassertTree(any, \"🔥\".characters, ==, \"🔥\")\n\t}\n\t\n\t// MARK: satisfy\n\t\n\tfunc testSatisfyIncrementsLinesOverNewlineCharacters() {\n\t\tlet parser = any *> %\"foo\"\n\t\tassertAdvancedBy(parser, input: \"\\nfoot\".characters, lineOffset: 1, columnOffset: 2, offset: 4)\n\t}\n}\n"
  },
  {
    "path": "MadnessTests/ReductionTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nfinal class ReductionTests: XCTestCase {\n\tlet reduction = %\"x\" --> { $4.uppercased() }\n\n\tfunc testMapsParseTreesWithAFunction() {\n\t\tassertTree(reduction, \"x\".characters, ==, \"X\")\n\t}\n\n\tfunc testRejectsInputRejectedByItsParser() {\n\t\tassertUnmatched(reduction, \"y\".characters)\n\t}\n\n\n\tenum Value { case null }\n\n\tlet constReduction = %\"null\" --> { _, _, _, _, _ in Value.null }\n\n\tfunc testMapsConstFunctionOverInput() {\n\t\tassertTree(constReduction, \"null\".characters, ==, Value.null)\n\t}\n\n\n\tlet reductionWithIndex = %\"x\" --> { \"\\($4.uppercased()):\\($0.distance(from: $0.startIndex, to: $3.lowerBound))..<\\($0.distance(from: $0.startIndex, to: $3.upperBound))\" }\n\n\tfunc testMapsParseTreesWithAFunctionWhichTakesTheSourceIndex() {\n\t\tassertTree(reductionWithIndex, \"x\".characters, ==, \"X:0..<1\")\n\t}\n}\n\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/RepetitionTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nfinal class RepetitionTests: XCTestCase {\n\tlet zeroOrMore: Parser<String.CharacterView, [String]>.Function = many(%\"x\")\n\n\tfunc testZeroOrMoreRepetitionAcceptsTheEmptyString() {\n\t\tassertMatched(zeroOrMore, input: \"\".characters)\n\t}\n\n\tfunc testZeroOrMoreRepetitionAcceptsUnmatchedStrings() {\n\t\tassertMatched(zeroOrMore, input: \"y\".characters)\n\t}\n\n\tfunc testZeroOrMoreRepetitionDoesNotAdvanceWithUnmatchedStrings() {\n\t\tassertAdvancedBy(zeroOrMore, input: \"y\".characters, offset: 0)\n\t}\n\n\tfunc testZeroOrMoreRepetitionParsesUnmatchedStringsAsEmptyArrays() {\n\t\tassertTree(zeroOrMore, \"y\".characters, ==, [])\n\t}\n\n\tfunc testZeroOrMoreRepetitionParsesAMatchedString() {\n\t\tassertTree(zeroOrMore, \"x\".characters, ==, [\"x\"])\n\t}\n\n\tfunc testZeroOrMoreRepetitionParsesMatchedStrings() {\n\t\tassertTree(zeroOrMore, \"xx\".characters, ==, [\"x\", \"x\"])\n\t}\n\n\n\tlet oneOrMore = some(%\"x\")\n\n\tfunc testOneOrMoreRepetitionRejectsTheEmptyString() {\n\t\tassertUnmatched(oneOrMore, \"\".characters)\n\t}\n\n\tfunc testOneOrMoreRepetitionParsesASingleMatchedString() {\n\t\tassertTree(oneOrMore, \"x\".characters, ==, [\"x\"])\n\t}\n\n\tfunc testOneOrMoreRepetitonParsesMultipleMatchedStrings() {\n\t\tassertTree(oneOrMore, \"xxy\".characters, ==, [\"x\", \"x\"])\n\t}\n\n\n\tlet exactlyN = %\"x\" * 3\n\n\tfunc testExactlyNRepetitionParsesNTrees() {\n\t\tassertTree(exactlyN, \"xxx\".characters, ==, [\"x\", \"x\", \"x\"])\n\t}\n\n\tfunc testExactlyNRepetitionParsesRejectsFewerMatches() {\n\t\tassertUnmatched(exactlyN, \"xx\".characters)\n\t}\n\n\tfunc testExactlyNRepetitionParsesStopsAtN() {\n\t\tassertAdvancedBy(exactlyN, input: \"xxxx\".characters, lineOffset: 0, columnOffset: 3, offset: 3)\n\t}\n\n\n\tlet zeroToN = %\"x\" * (0..<2)\n\n\tfunc testZeroToNRepetitionParsesZeroTrees() {\n\t\tassertTree(zeroToN, \"y\".characters, ==, [])\n\t}\n\n\tfunc testZeroToNRepetitionParsesUpToButNotIncludingNTrees() {\n\t\tassertTree(zeroToN, \"xxx\".characters, ==, [\"x\"])\n\t\tassertAdvancedBy(zeroToN, input: \"xxx\".characters, lineOffset: 0, columnOffset: 1, offset: 1)\n\t}\n\n\n\tlet atLeastN = %\"x\" * (2..<Int.max)\n\n\tfunc testAtLeastNRepetitionRejectsZeroTrees() {\n\t\tassertUnmatched(atLeastN, \"y\".characters)\n\t}\n\n\tfunc testAtLeastNRepetitionParsesNTrees() {\n\t\tassertTree(atLeastN, \"xx\".characters, ==, [\"x\", \"x\"])\n\t}\n\n\tfunc testAtLeastNRepetitionParsesMoreThanNTrees() {\n\t\tassertTree(atLeastN, \"xxxx\".characters, ==, [\"x\", \"x\", \"x\", \"x\"])\n\t}\n\n\n\tlet mToN = %\"x\" * (2..<3)\n\n\tfunc testMToNRepetitionRejectsLessThanM() {\n\t\tassertUnmatched(mToN, \"x\".characters)\n\t}\n\n\tfunc testMToNRepetitionMatchesUpToButNotIncludingN() {\n\t\tassertAdvancedBy(mToN, input: \"xxxx\".characters, lineOffset: 0, columnOffset: 2, offset: 2)\n\t}\n\n\n\tlet nToN = %\"x\" * (2..<2)\n\n\tfunc testOpenNToNRepetitionRejectsN() {\n\t\tassertUnmatched(nToN, \"xx\".characters)\n\t}\n\n\n\n\tlet zeroToNClosed = %\"x\" * (0...2)\n\n\tfunc testZeroToNClosedRepetitionParsesZeroTrees() {\n\t\tassertTree(zeroToNClosed, \"y\".characters, ==, [])\n\t}\n\n\tfunc testZeroToNClosedRepetitionParsesUpToNTrees() {\n\t\tassertTree(zeroToNClosed, \"xxx\".characters, ==, [\"x\", \"x\"])\n\t\tassertAdvancedBy(zeroToNClosed, input: \"xxx\".characters, lineOffset: 0, columnOffset: 2, offset: 2)\n\t}\n\n\n\tlet atLeastNClosed = %\"x\" * (2...Int.max)\n\n\tfunc testAtLeastNClosedRepetitionRejectsZeroTrees() {\n\t\tassertUnmatched(atLeastNClosed, \"y\".characters)\n\t}\n\n\tfunc testAtLeastNClosedRepetitionParsesNTrees() {\n\t\tassertTree(atLeastNClosed, \"xx\".characters, ==, [\"x\", \"x\"])\n\t}\n\n\tfunc testAtLeastNClosedRepetitionParsesMoreThanNTrees() {\n\t\tassertTree(atLeastNClosed, \"xxxx\".characters, ==, [\"x\", \"x\", \"x\", \"x\"])\n\t}\n\n\n\tlet mToNClosed = %\"x\" * (2...3)\n\n\tfunc testMToNClosedRepetitionRejectsLessThanM() {\n\t\tassertUnmatched(mToNClosed, \"x\".characters)\n\t}\n\n\tfunc testMToNClosedRepetitionMatchesUpToN() {\n\t\tassertAdvancedBy(mToNClosed, input: \"xxxx\".characters, lineOffset: 0, columnOffset: 3, offset: 3)\n\t}\n\n\n\tlet closedNToN = %\"x\" * (2...2)\n\n\tfunc testClosedNToNRepetitionMatchesUpToN() {\n\t\tassertAdvancedBy(closedNToN, input: \"xxx\".characters, lineOffset: 0, columnOffset: 2, offset: 2)\n\t}\n\n\n\t// MARK: Repetition shorthand\n\n\tlet zeroOrMoreSimple = many(%\"x\")\n\n\tfunc testZeroOrMoreSimpleRepetitionAcceptsTheEmptyString() {\n\t\tassertMatched(zeroOrMoreSimple, input: \"\".characters)\n\t}\n\n\tfunc testZeroOrMoreSimpleRepetitionAcceptsUnmatchedStrings() {\n\t\tassertMatched(zeroOrMoreSimple, input: \"y\".characters)\n\t}\n\n\tfunc testZeroOrMoreSimpleRepetitionDoesNotAdvanceWithUnmatchedStrings() {\n\t\tassertAdvancedBy(zeroOrMoreSimple, input: \"y\".characters, offset: 0)\n\t}\n\n\tfunc testZeroOrMoreSimpleRepetitionParsesUnmatchedStringsAsEmptyArrays() {\n\t\tassertTree(zeroOrMoreSimple, \"y\".characters, ==, [])\n\t}\n\n\tfunc testZeroOrMoreSimpleRepetitionParsesAMatchedString() {\n\t\tassertTree(zeroOrMoreSimple, \"x\".characters, ==, [\"x\"])\n\t}\n\n\tfunc testZeroOrMoreSimpleRepetitionParsesMatchedStrings() {\n\t\tassertTree(zeroOrMoreSimple, \"xx\".characters, ==, [\"x\", \"x\"])\n\t}\n\n\n\tlet oneOrMoreSimple = some(%\"x\")\n\n\tfunc testOneOrMoreSimpleRepetitionRejectsTheEmptyString() {\n\t\tassertUnmatched(oneOrMoreSimple, \"\".characters)\n\t}\n\n\tfunc testOneOrMoreSimpleRepetitionParsesASingleMatchedString() {\n\t\tassertTree(oneOrMoreSimple, \"x\".characters, ==, [\"x\"])\n\t}\n\n\tfunc testOneOrMoreSimpleRepetitonParsesMultipleMatchedStrings() {\n\t\tassertTree(oneOrMoreSimple, \"xxy\".characters, ==, [\"x\", \"x\"])\n\t}\n\n\n\tlet zeroOrMoreLookAhead = many(not(%\"x\"))\n\n\tfunc testZeroOrMoreSkipsLookAhead() {\n\t\tassertTree(zeroOrMoreLookAhead, \"yyy\".characters, ==, [])\n\t}\n\n\n\tlet oneOrMoreLookAhead = some(not(%\"x\"))\n\n\tfunc testOneOrMoreFailsLookAhead() {\n\t\tassertUnmatched(oneOrMoreLookAhead, \"yyy\".characters)\n\t}\n\t\n\t// MARK: - endBy1\n\t\n\tlet numbers = endBy1(digit, %\".\")\n\t\n\tfunc testOneOrMoreRepetitionWithEndRejectsTheEmptyString() {\n\t\tassertUnmatched(numbers, \"\".characters)\n\t}\n\t\n\tfunc testOneOrMoreRepetitionWithEndParsesASingleMatchedString() {\n\t\tassertTree(numbers, \"0.\".characters, ==, [\"0\"])\n\t}\n\t\n\tfunc testOneOrMoreRepetitionWithEndParsesMultipleMatchedStrings() {\n\t\tassertTree(numbers, \"0.1.2.\".characters, ==, [\"0\", \"1\", \"2\"])\n\t}\n\t\n\t// MARK: - endBy\n\t\n\tlet numbers2 = endBy(digit, %\".\")\n\t\n\tfunc testZeroOrMoreRepetitionWithEndAcceptsTheEmptyString() {\n\t\tassertMatched(numbers2, input: \"\".characters)\n\t}\n\t\n\tfunc testZeroOrMoreRepetitionWithEndParsesASingleMatchedString() {\n\t\tassertTree(numbers2, \"0.\".characters, ==, [\"0\"])\n\t}\n\t\n\tfunc testZeroOrMoreRepetitionWithEndParsesMultipleMatchedStrings() {\n\t\tassertTree(numbers2, \"0.1.2.\".characters, ==, [\"0\", \"1\", \"2\"])\n\t}\n}\n\nprivate func == (left: [()], right: [()]) -> Bool {\n\treturn left.count == right.count\n}\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "MadnessTests/StringTests.swift",
    "content": "//  Copyright (c) 2015 Rob Rix. All rights reserved.\n\nfinal class StringTests: XCTestCase {\n\tfunc testSimpleIntegers() {\n\t\tassertNumber(\"1\")\n\t\tassertNumber(\"45\")\n\t\tassertNumber(\"-13\")\n\t}\n\n\tfunc testSimpleFloats() {\n\t\tassertNumber(\"1.0\")\n\t\tassertNumber(\"45.3\")\n\t\tassertNumber(\"-2.53\")\n\t}\n\n\tfunc testIntegerUnsignedExponents() {\n\t\tassertNumber(\"2E1\")\n\t\tassertNumber(\"1e2\")\n\t\tassertNumber(\"0e3\")\n\t\tassertNumber(\"-1e4\")\n\t\tassertNumber(\"-2E5\")\n\t\tassertNumber(\"1e21\")\n\t}\n\n\tfunc testIntegerSignedExponents() {\n\t\tassertNumber(\"8e+1\")\n\t\tassertNumber(\"7e-2\")\n\t\tassertNumber(\"6E+3\")\n\t\tassertNumber(\"5E-4\")\n\t\tassertNumber(\"-4e+5\")\n\t\tassertNumber(\"-3e-6\")\n\t\tassertNumber(\"-2E+7\")\n\t\tassertNumber(\"-1E-8\")\n\t}\n\n\tfunc testFloatUnsignedExponents() {\n\t\tassertNumber(\"1.2e1\")\n\t\tassertNumber(\"4.567E2\")\n\t\tassertNumber(\"1.0e4\")\n\t\tassertNumber(\"-6.21e3\")\n\t\tassertNumber(\"-1.5E2\")\n\t}\n\n\tfunc testFloatSignedExponents() {\n\t\tassertNumber(\"1.4e+5\")\n\t\tassertNumber(\"2.5e-6\")\n\t\tassertNumber(\"3.6E+7\")\n\t\tassertNumber(\"4.7E-8\")\n\t\tassertNumber(\"-5.8E-9\")\n\t}\n}\n\nfunc assertNumber(_ input: String, message: String = \"\", file: StaticString = #file, line: UInt = #line) {\n\treturn XCTAssertEqual(parse(number, input: input).value, Double(input)!, message, file: file, line: line)\n}\n\n// MARK: - Imports\n\nimport Madness\nimport XCTest\n"
  },
  {
    "path": "README.md",
    "content": "# Recursive Descent into Madness\n\nMadness is a Swift µframework for parsing strings in simple context-free grammars. Combine parsers from simple Swift expressions and parse away:\n\n```swift\nlet digit = %(\"0\"...\"9\") <|> %(\"a\"...\"f\") <|> %(\"A\"...\"F\")\nlet hex = digit+ |> map { strtol(join(\"\", $0), nil, 16) }\nparse(%\"0x\" *> hex, \"0xdeadbeef\") // => 3,735,928,559\n```\n\nYour parsers can produce your own model objects directly, making Madness ideal for experimenting with grammars, for example in a playground.\n\n![screenshot of parsing HTML colours in an Xcode playground: `let reddish = parse(colour, \"#d52a41\")!`](https://cloud.githubusercontent.com/assets/59671/5415280/1453c774-81f4-11e4-8726-b51423bb06f9.png)\n\nSee `Madness.playground` for some examples of parsing with Madness.\n\n\n## Use\n\n- **Lexing**\n\n\tMadness can be used to write lexers, lexeme parsers, and scannerless parsers. @bencochran has built a [lexer and parser for the LLVM tutorial language, Kaleidoscope](https://github.com/bencochran/KaleidoscopeLang).\n\n- **Any**\n\n\t```swift\n\tany\n\t```\n\n\tparses any single character.\n\n- **Strings**\n\n\t```swift\n\t%\"hello\"\n\t```\n\n\tparses the string “hello”.\n\n- **Ranges**\n\n\t```swift\n\t%(\"a\"...\"z\")\n\t```\n\n\tparses any lowercase letter from “a” to “z” inclusive.\n\n- **Concatenation**\n\n\t```swift\n\tx <*> y <*> z\n\t```\n\n\tparses `x` followed by `y` and produces parses as `(X, Y)`.\n\n- **Alternation**\n\n\t```swift\n\tx <|> y\n\t```\n\n\tparses `x`, and if it fails, `y`, and produces parses as `Either<X, Y>`. If `x` and `y` are of the same type, then it produces parses as `X`.\n\n\t```swift\n\toneOf([x1, x2, x3])\n\t```\n\n\ttries a sequence of parsers until the first success, producing parses as `X`.\n\n\t```swift\n\tanyOf([\"x\", \"y\", \"z\"])\n\t```\n\n\ttries to parse one each of a set of literals in sequence, collecting each successful parse into an array until none match.\n\n\t```swift\n\tallOf([\"x\", \"y\", \"z\"])\n\t```\n\n\tgreedier than `anyOf`, parsing every match from a set of literals in sequence, including duplicates.\n\n- **Repetition**\n\n\t```swift\n\tx*\n\t```\n\n\tparses `x` 0 or more times, producing parses as `[X]`.\n\n\t```swift\n\tx+\n\t```\n\n\tparses `x` one or more times.\n\n\t```swift\n\tx * 3\n\t```\n\n\tparses `x` exactly three times.\n\n\t```swift\n\tx * (3..<6)\n\t```\n\n\tparses `x` three to five times. Use `Int.max` for the upper bound to parse three or more times.\n\n- **Mapping**\n\n\t```swift\n\tx |> map { $0 }\n\t{ $0 } <^> x\n\tx --> { _, _, y in y }\n\t```\n\n\tparses `x` and maps its parse trees using the passed function. Use mapping to build your model objects. `-->` passes the input and parsed range as well as the parsed data for e.g. error reporting or AST construction.\n\n- **Ignoring**\n\n\tSome text is just decoration. `x *> y` parses `x` and then `y` just like `<*>`, but drops the result of `x`. `x <* y` does the same, but drops the result of `y`.\n\nAPI documentation is in the source.\n\n\n## This way Madness lies\n\n### ∞ loop de loops\n\nMadness employs simple—naïve, even—recursive descent parsing. Among other things, that means that it can’t parse any arbitrary grammar that you could construct with it. In particular, it can’t parse left-recursive grammars:\n\n```swift\nlet number = %(\"0\"...\"9\")\nlet addition = expression <*> %\"+\" <*> expression\nlet expression = addition <|> number\n```\n\n`expression` is left-recursive: its first term is `addition`, whose first term is `expression`. This will cause infinite loops every time `expression` is invoked; try to avoid it.\n\n\n### I love ambiguity more than [@numist](https://twitter.com/numist/status/423722622031908864)\n\nAlternations try their left operand before their operand, and are short-circuiting. This means that they disambiguate (arbitrarily) to the left, which can be handy; but this can have unintended consequences. For example, this parser:\n\n```swift\n%\"x\" <|> %\"xx\"\n```\n\nwill not parse “xx” completely.\n\n\n## Integration\n\n1. Add this repository as a submodule and check out its dependencies, and/or [add it to your Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) if you’re using [carthage](https://github.com/Carthage/Carthage/) to manage your dependencies.\n2. Drag `Madness.xcodeproj` into your project or workspace, and do the same with its dependencies (i.e. the other `.xcodeproj` files included in `Madness.xcworkspace`). NB: `Madness.xcworkspace` is for standalone development of Madness, while `Madness.xcodeproj` is for targets using Madness as a dependency.\n3. Link your target against `Madness.framework` and each of the dependency frameworks.\n4. Application targets should ensure that the framework gets copied into their application bundle. (Framework targets should instead require the application linking them to include Madness and its dependencies.)\n"
  },
  {
    "path": "script/cibuild",
    "content": "#!/bin/bash\n\nBUILD_DIRECTORY=\"build\"\nCONFIGURATION=Release\n\nif [[ -z $TRAVIS_XCODE_WORKSPACE ]]; then\n    echo \"Error: \\$TRAVIS_XCODE_WORKSPACE is not set.\"\n    exit 1\nfi\n\nif [[ -z $TRAVIS_XCODE_SCHEME ]]; then\n    echo \"Error: \\$TRAVIS_XCODE_SCHEME is not set!\"\n    exit 1\nfi\n\nif [[ -z $XCODE_ACTION ]]; then\n    echo \"Error: \\$XCODE_ACTION is not set!\"\n    exit 1\nfi\n\nif [[ -z $XCODE_SDK ]]; then\n    echo \"Error: \\$XCODE_SDK is not set!\"\n    exit 1\nfi\n\nif [[ -z $XCODE_DESTINATION ]]; then\n    echo \"Error: \\$XCODE_DESTINATION is not set!\"\n    exit 1\nfi\n\nset -o pipefail\nxcodebuild $XCODE_ACTION \\\n    -workspace \"$TRAVIS_XCODE_WORKSPACE\" \\\n    -scheme \"$TRAVIS_XCODE_SCHEME\" \\\n    -sdk \"$XCODE_SDK\" \\\n    -destination \"$XCODE_DESTINATION\" \\\n    -derivedDataPath \"${BUILD_DIRECTORY}\" \\\n    -configuration $CONFIGURATION \\\n    ENABLE_TESTABILITY=YES \\\n    GCC_GENERATE_DEBUGGING_SYMBOLS=NO \\\n    RUN_CLANG_STATIC_ANALYZER=NO | xcpretty\nresult=$?\n\nif [ \"$result\" -ne 0 ]; then\n    exit $result\nfi\n\n# Compile code in playgrounds \nif [[ -n $XCODE_PLAYGROUND ]]; then\n    echo \"Validating playground...\"\n    . script/validate-playground.sh\nfi\n"
  },
  {
    "path": "script/validate-playground.sh",
    "content": "#!/bin/bash\n\n# Bash script to lint the content of playgrounds\n# Heavily based on RxSwift's\n# https://github.com/ReactiveX/RxSwift/blob/master/scripts/validate-playgrounds.sh\n\nif [ -z \"$BUILD_DIRECTORY\" ]; then\n    echo \"\\$BUILD_DIRECTORY is not set. Are you trying to run \\`validate-playgrounds.sh\\` without building Logician first?\\n\"\n    echo \"To validate the playground, run \\`script/build\\`.\"\n    exit 1\nfi\n\nif [ -z \"$XCODE_PLAYGROUND\" ]; then\n    echo \"\\$XCODE_PLAYGROUND is not set.\"\n    exit 1\nfi\n\nPAGES_PATH=${BUILD_DIRECTORY}/Build/Products/${CONFIGURATION}/all-playground-pages.swift\n\ncat ${XCODE_PLAYGROUND}/Sources/*.swift ${XCODE_PLAYGROUND}.playground/Pages/**/*.swift > ${PAGES_PATH}\n\nswift -v -target \"x86_64-apple-macosx10.10\" -D NOT_IN_PLAYGROUND -F ${BUILD_DIRECTORY}/Build/Products/${CONFIGURATION} ${PAGES_PATH} > /dev/null\nresult=$?\n\n# Cleanup\nrm -Rf $BUILD_DIRECTORY\n\nexit $result\n"
  }
]