Get rid of core shadow warnings.
This commit is contained in:
parent
faca700cae
commit
aa3692a141
|
@ -20,8 +20,8 @@
|
||||||
(pp/pprint (:errors parsed))
|
(pp/pprint (:errors parsed))
|
||||||
(System/exit 66))
|
(System/exit 66))
|
||||||
(let [interpreted (interpreter/interpret parsed)]
|
(let [interpreted (interpreter/interpret parsed)]
|
||||||
(println " *** *** ***")
|
;;(println " *** *** ***")
|
||||||
(println "I ran your script; here's the output: ")
|
;;(println "I ran your script; here's the output: ")
|
||||||
(pp/pprint interpreted)
|
(pp/pprint interpreted)
|
||||||
(System/exit 0)))))))
|
(System/exit 0)))))))
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
;; it's got runtime checking
|
;; it's got runtime checking
|
||||||
;; we should be able to do these checks statically
|
;; we should be able to do these checks statically
|
||||||
;; that's for later, tho
|
;; that's for later, tho
|
||||||
(defn- resolve [word ctx-atom]
|
(defn- resolve-word[word ctx-atom]
|
||||||
(let [ctx @ctx-atom]
|
(let [ctx @ctx-atom]
|
||||||
(if (contains? ctx word)
|
(if (contains? ctx word)
|
||||||
(get ctx word)
|
(get ctx word)
|
||||||
|
@ -207,7 +207,7 @@
|
||||||
|
|
||||||
::ast/atom (:value ast)
|
::ast/atom (:value ast)
|
||||||
|
|
||||||
::ast/word (resolve (:word ast) ctx)
|
::ast/word (resolve-word(:word ast) ctx)
|
||||||
|
|
||||||
::ast/let (interpret-let ast ctx)
|
::ast/let (interpret-let ast ctx)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
(defn- current [parser]
|
(defn- current [parser]
|
||||||
(nth (::tokens parser) (::token parser) nil))
|
(nth (::tokens parser) (::token parser) nil))
|
||||||
|
|
||||||
(defn- peek [parser]
|
(defn- ppeek [parser]
|
||||||
(nth (::tokens parser) (inc (::token parser)) nil))
|
(nth (::tokens parser) (inc (::token parser)) nil))
|
||||||
|
|
||||||
(defn- at-end? [parser]
|
(defn- at-end? [parser]
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
::token/rbrace
|
::token/rbrace
|
||||||
::token/eof})
|
::token/eof})
|
||||||
|
|
||||||
(defn- sync [parser message origin end]
|
(defn- psync [parser message origin end]
|
||||||
(let [poison {::ast/type ::ast/poison
|
(let [poison {::ast/type ::ast/poison
|
||||||
:message message
|
:message message
|
||||||
:origin origin
|
:origin origin
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
(let [curr (current parser)
|
(let [curr (current parser)
|
||||||
type (::token/type curr)]
|
type (::token/type curr)]
|
||||||
(if (or (at-end? parser) (contains? sync-on type))
|
(if (or (at-end? parser) (contains? sync-on type))
|
||||||
(sync parser message origin curr)
|
(psync parser message origin curr)
|
||||||
(recur (advance parser))))))))
|
(recur (advance parser))))))))
|
||||||
|
|
||||||
;; some helper functions
|
;; some helper functions
|
||||||
|
@ -548,14 +548,14 @@
|
||||||
(parse-atom parser)
|
(parse-atom parser)
|
||||||
|
|
||||||
::token/keyword
|
::token/keyword
|
||||||
(let [next (peek parser)
|
(let [next (ppeek parser)
|
||||||
type (::token/type next)]
|
type (::token/type next)]
|
||||||
(if (= type ::token/lparen)
|
(if (= type ::token/lparen)
|
||||||
(parse-synthetic parser)
|
(parse-synthetic parser)
|
||||||
(parse-atom parser)))
|
(parse-atom parser)))
|
||||||
|
|
||||||
::token/word
|
::token/word
|
||||||
(let [next (peek parser)
|
(let [next (ppeek parser)
|
||||||
type (::token/type next)]
|
type (::token/type next)]
|
||||||
(case type
|
(case type
|
||||||
(::token/lparen ::token/keyword) (parse-synthetic parser)
|
(::token/lparen ::token/keyword) (parse-synthetic parser)
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
::data/type ::data/clj
|
::data/type ::data/clj
|
||||||
:body /})
|
:body /})
|
||||||
|
|
||||||
(def inc {:name "inc"
|
(def inc- {:name "inc"
|
||||||
::data/type ::data/clj
|
::data/type ::data/clj
|
||||||
:body inc})
|
:body inc})
|
||||||
|
|
||||||
(def dec {:name "dec"
|
(def dec- {:name "dec"
|
||||||
::data/type ::data/clj
|
::data/type ::data/clj
|
||||||
:body dec})
|
:body dec})
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
::data/type ::data/clj
|
::data/type ::data/clj
|
||||||
:body (fn [& args] (throw (ex-info "Ludus panicked!" {:args args})))})
|
:body (fn [& args] (throw (ex-info "Ludus panicked!" {:args args})))})
|
||||||
|
|
||||||
(def print {:name "print"
|
(def print- {:name "print"
|
||||||
::data/type ::data/clj
|
::data/type ::data/clj
|
||||||
:body (fn [& args]
|
:body (fn [& args]
|
||||||
(println (str args))
|
(println (str args))
|
||||||
|
@ -47,10 +47,10 @@
|
||||||
(def prelude {"eq" eq
|
(def prelude {"eq" eq
|
||||||
"add" add
|
"add" add
|
||||||
"panic!" panic!
|
"panic!" panic!
|
||||||
"print" print
|
"print" print-
|
||||||
"sub" sub
|
"sub" sub
|
||||||
"mult" mult
|
"mult" mult
|
||||||
"div" div
|
"div" div
|
||||||
"inc" inc
|
"inc" inc-
|
||||||
"dec" dec
|
"dec" dec-
|
||||||
"not" not})
|
"not" not})
|
Loading…
Reference in New Issue
Block a user