 		)
 
 		add_named_rule("insert-dml-statement", rule: (
-				Parser.matchLiteralInsensitive("INSERT") => {
+				Parser.matchLiteralInsensitive("INSERT") => { [unowned self] in
 					self.stack.append(.statement(.insert(SQLInsert(orReplace: false, into: SQLTable(name: ""), columns: [], values: []))))
 				}
-				~~ ((Parser.matchLiteralInsensitive("OR REPLACE") => {
+				~~ ((Parser.matchLiteralInsensitive("OR REPLACE") => { [unowned self] in
 					guard case .statement(let statement) = self.stack.popLast()! else { fatalError() }
 					guard case .insert(var insert) = statement else { fatalError() }
 					insert.orReplace = true
 					self.stack.append(.statement(.insert(insert)))
 				})/~)
 				~~ Parser.matchLiteralInsensitive("INTO")
-				~~ (^"id-table" => { self.stack.append(.tableIdentifier(SQLTable(name: self.text))) })
-				~~ ((Parser.matchLiteral("(") => { self.stack.append(.columnList([])) }) ~~ ^"column-list" ~~ Parser.matchLiteral(")"))
+				~~ (^"id-table" => { [unowned self] in
+                    self.stack.append(.tableIdentifier(SQLTable(name: self.text)))
+                })
+				~~ ((Parser.matchLiteral("(") => { [unowned self] in
+                    self.stack.append(.columnList([]))
+                })
+                ~~ ^"column-list" ~~ Parser.matchLiteral(")"))
 				~~ Parser.matchLiteralInsensitive("VALUES")
-					=> {
+					=> { [unowned self] in
 						guard case .columnList(let cs) = self.stack.popLast()! else { fatalError() }
 						guard case .tableIdentifier(let tn) = self.stack.popLast()! else { fatalError() }
 						guard case .statement(let statement) = self.stack.popLast()! else { fatalError() }

			| (^"lit-column-naked" ~ (^"lit-call")/~)
		)

		add_named_rule("lit-all-columns", rule: Parser.matchLiteral("*") => {
			self.stack.append(.expression(.allColumns))
		})

		add_named_rule("lit-blob", rule: Parser.matchLiteral("X'") ~ Parser.matchAnyCharacterExcept([Character("'")])* => pushLiteralBlob ~ Parser.matchLiteral("'"))

		add_named_rule("lit-string", rule: Parser.matchLiteral("'")
			~ (Parser.matchAnyCharacterExcept([Character("'")]) | Parser.matchLiteral("''"))* => pushLiteralString
			~ Parser.matchLiteral("'"))

		add_named_rule("lit-constant", rule:

				self.stack.append(.statement(.select(select)))
			})
			~~ (
					Parser.matchLiteralInsensitive("FROM") ~~ ^"id-table" => { [unowned self] in
						guard case .statement(let st) = self.stack.popLast()! else { fatalError() }
						guard case .select(var select) = st else { fatalError() }
						select.from = SQLTable(name: self.text)
						self.stack.append(.statement(.select(select)))
					}
					~~ ((Parser.matchLiteralInsensitive("LEFT JOIN") => { [unowned self] in
							self.stack.append(.join(.left(table: SQLTable(name: ""), on: SQLExpression.null)))
						}
						~~ ^"id-table" => { [unowned self] in
							guard case .join(let join) = self.stack.popLast()! else { fatalError() }
							guard case .left(table: _, on: _) = join else { fatalError() }
							self.stack.append(.join(.left(table: SQLTable(name: self.text), on: SQLExpression.null)))
						}
						~~ Parser.matchLiteralInsensitive("ON")
						~~ ^"ex" => { [unowned self] in
							guard case .expression(let expression) = self.stack.popLast()! else { fatalError() }
							guard case .join(let join) = self.stack.popLast()! else { fatalError() }
							guard case .left(table: let table, on: _) = join else { fatalError() }
							self.stack.append(.join(.left(table: table, on: expression)))
						}) => { [unowned self] in
							guard case .join(let join) = self.stack.popLast()! else { fatalError() }
							guard case .statement(let st) = self.stack.popLast()! else { fatalError() }
							guard case .select(var select) = st else { fatalError() }
							select.joins.append(join)
							self.stack.append(.statement(.select(select)))
						})*
					~~ (Parser.matchLiteralInsensitive("WHERE") ~~ ^"ex" => { [unowned self] in
						guard case .expression(let expression) = self.stack.popLast()! else { fatalError() }
						guard case .statement(let st) = self.stack.popLast()! else { fatalError() }
						guard case .select(var select) = st else { fatalError() }
