Get it working! Ludus in cljs works.
This commit is contained in:
parent
8a456e1d02
commit
8c19cca9e7
|
@ -11,9 +11,7 @@
|
||||||
|
|
||||||
(declare expression pattern)
|
(declare expression pattern)
|
||||||
|
|
||||||
; (defp separator choice [:comma :newline :break])
|
(defp separator choice [:comma :newline :break])
|
||||||
|
|
||||||
(defn separator [] (choice :separator [:comma :newline :break]))
|
|
||||||
|
|
||||||
(defp separators quiet one+ separator)
|
(defp separators quiet one+ separator)
|
||||||
|
|
||||||
|
|
|
@ -84,10 +84,16 @@
|
||||||
[scanner]
|
[scanner]
|
||||||
(subs (:source scanner) (:start scanner) (:current scanner)))
|
(subs (:source scanner) (:start scanner) (:current scanner)))
|
||||||
|
|
||||||
|
(defn- char-code [char]
|
||||||
|
#?(
|
||||||
|
:clj (int char)
|
||||||
|
:cljs (.charCodeAt char 0)
|
||||||
|
))
|
||||||
|
|
||||||
(defn- char-in-range? [start end char]
|
(defn- char-in-range? [start end char]
|
||||||
(and char
|
(and char
|
||||||
(>= (int char) (int start))
|
(>= (char-code char) (char-code start))
|
||||||
(<= (int char) (int end))))
|
(<= (char-code char) (char-code end))))
|
||||||
|
|
||||||
(defn- digit? [c]
|
(defn- digit? [c]
|
||||||
(char-in-range? \0 \9 c))
|
(char-in-range? \0 \9 c))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user