     _ (&string-end-quote long? q)]
    [:string [s long? q ub r]]))
 
+(defn &intpart [prefix]
+  (&conj (&char-if decimal-digit) prefix))
+
+(defn &fraction [prefix]
+  (&do (&char= \.) (&intpart (conj prefix \.))))
+
+(defn &exponent [prefix]
+  (&let [c (&char-if #{\e \E})
+         s (&optional (&char-if #{\+ \-}))
+         e (&intpart (list* s c prefix))]
+        e))
+
+(def &point-float
+  (&or (&bind (&optional (&intpart ())) &fraction)
+       (&let [i (&intpart ()) c (&char= \.)] (conj i c))))
+
+(def &exponent-float
+  (&bind (&or &point-float (&intpart ())) &exponent))
+
+(def &float-literal
+  (&let [x (&or &exponent-float &point-float)]
+     [:float (Double/parseDouble (stringify x))]))
+
+(def &decimal-integer
+  (&chars (&char-if decimal-digit) '("10r")))
+
+(def &octal-integer
+  (&chars (&char-if octal-digit) '("8r")))
+
+(def &hexadecimal-integer
+  (&chars (&char-if hexadecimal-digit) '("16r")))
+
+(def &binary-integer
+  (&chars (&char-if #{\0 \1}) '("2r")))
+
+(def &integer-literal
+  (&let [c &peek-char
+         i (cond
+            (= c \0) (&bind (&do &read-char &peek-char)
+                            (fn [c] (cond (#{\o \O} c) (&do &read-char &octal-integer)
+                                          (#{\x \X} c) (&do &read-char &hexadecimal-integer)
+                                          (#{\b \B} c) (&do &read-char &binary-integer)
+                                          (octal-digit c) &octal-integer
+                                          :else (&return "0"))))
+            (decimal-digit c) &decimal-integer
+            :else &fail)
+         _ (&optional (&char-if #{\l \L}))]
+    [:integer (edn/read-string i)]))
+
 (def &numeric-literal
-  (&error {:r "&numeric-literal is not implemented yet"}))
+  (&or &float-literal &integer-literal))
 
 (def delimiters
   '("@" "," ":" "." "`" "=" ";"

(defmacro int<-digits [base & digits]
  (reduce #(do `(+ (* ~% ~base) ~%2)) digits))

(defn oct-digit [c]
  (when-let [n (and c (int c))]
    (when (<= (int \0) n (int \7)) (- n (int \0)))))

(def &oct-digit (&let [c &read-char] (or (oct-digit c) (fail))))

(def &octal-char
  (&let [o0 &oct-digit o1 &oct-digit o2 &oct-digit]
     (char (int<-digits 8 o0 o1 o2))))

(defn dec-digit [c]
  (when-let [n (and c (int c))]
    (when (<= (int \0) n (int \9)) (- n (int \0)))))

(def &dec-digit (&let [c &read-char] (or (dec-digit c) (fail))))

(defn hex-digit [c]
  (when-let [n (and c (int c))]
    (cond (<= (int \0) n (int \9)) (- n (int \0))
          (<= (int \a) n (int \f)) (+ n (- 10 (int \a)))
          (<= (int \A) n (int \F)) (+ n (- 10 (int \A))))))

(def &hex-digit (&let [c &read-char] (or (hex-digit c) (fail))))

(def &latin1-char
  (&let [x0 &hex-digit x1 &hex-digit]
     (char (int<-digits 16 x0 x1))))

(def &unicode-char-16
  (&let [x0 &hex-digit x1 &hex-digit x2 &hex-digit x3 &hex-digit]
     (char (int<-digits 16 x0 x1 x2 x3))))

(def &unicode-char-32
  (&let [x0 &hex-digit x1 &hex-digit x2 &hex-digit x3 &hex-digit
         x4 &hex-digit x5 &hex-digit x6 &hex-digit x7 &hex-digit]
     (char (int<-digits 16 x0 x1 x2 x3 x4 x5 x6 x7))))

(defn &escape-seq [ub r]

  (first (&python (init-state input))))

(comment
  (defn tryf [fun] (try (fun) (catch clojure.lang.ExceptionInfo x (.data x))))

  (defn test-lex* [input] (tryf #(python-lexer input)))

  (defn test-lex [input] (map (fn [[a b _]] [a b]) (test-lex* input)))

  (defn test& [l input] (tryf #(l (init-state input))))

  (test-lex "
def hello (world, *more)
  print()
  \"a b\" + 'c d' + \\
  foo['abcd',
bar, \"1 2 3\", 0, 1, [ 2, 03, 0b101, 0x7, 0o13, 0O15, 0X11 ],
12.345e+67 1. 1.0 10e-1 .1e1 .01e+2
     # comment
  baz]
def quux ()
  {ur\"x\": \"a\"}")
);comment
