 (defn python-lexer [input]
   (first (&python (init-state input))))
 
-
-
 (comment
-  (python-lexer "def hello \"abcd\"\n  foo\\nbar\n     # comment\n  baz\ndef quux\n  ur\"x\"")
-
+  (defn test-python-lexer [input]
+    (try (python-lexer input) (catch clojure.lang.ExceptionInfo x (.data x))))
+
+  (test-python-lexer "
+def hello \"abcd\"
+  foo\\
+bar '1 2 3'
+     # comment
+  baz
+def quux
+  ur\"x\"")
+  (python-lexer "def hello abcd\n  foo\n  baz\ndef quux\n  ur\"x\\\"\"")
 );comment


(def whitespace #{\space \tab \formfeed})

(def &whitespace
  (&repeat (&char-if whitespace)))

(def crlf #{\return \newline})

(def &eol

(def &line-continuation
  (&do &backslash &eol))

(def &whitespace
  (&repeat (&or (&char-if whitespace) &line-continuation)))

(def &leading-whitespace-continued
  (&let
    [column &leading-whitespace-raw
