 
 func makeArithmeticParser() -> ParserProtocol {
 
-    let space = " \t".match
+    let space = " ".match
     let skip = space.some.maybe
     let digit = (0...9).match
-    let op = "+-*/".match.tag("op") >>> skip
+    let op = "+-*".match.tag("op") >>> skip
     let numeral = skip >>> digit.some.tag("numeral") >>> skip
     let expression = Deferred()
-    let compound = numeral.tag("first") >>> op >>> expression.tag("second")
+    let compound = op >>> expression.tag("first") >>> expression.tag("second")
     expression.parser = compound | numeral
     return expression
 }


func runArithmetic() {
    do {
        let input = "  123+  52 \t +  891   -3120   "
        let intermediateSyntaxTree = makeArithmeticParser().parse(input)
        let abstractSyntaxTree = try makeArithmeticTransformer().transform(intermediateSyntaxTree)
        let result = abstractSyntaxTree.evaluate()
        print("\(input) = \(result)")
    } catch {
        print(error)
    }

        return ArithmeticConstant(value: int)
    }
    
    transformer.transform(["first": .simple("f"), "second": .simple("s"), "op": .literal("+")]) { args in
        ArithmeticOperation(first: try args.transformed("f"), second: try args.transformed("s")) { a, b in a + b }
    }
    
    transformer.transform(["first": .simple("f"), "second": .simple("s"), "op": .literal("-")]) { args in
        ArithmeticOperation(first: try args.transformed("f"), second: try args.transformed("s")) { a, b in a - b }
    }
    
    transformer.transform(["first": .simple("f"), "second": .simple("s"), "op": .literal("*")]) { args in
        ArithmeticOperation(first: try args.transformed("f"), second: try args.transformed("s")) { a, b in a * b }
    }
    
    return transformer
