bunch of small changes
This commit is contained in:
parent
5875205899
commit
664ba9b13d
@ -31,10 +31,10 @@
|
||||
|
||||
(λ main-loop [in out]
|
||||
(local send (partial json-rpc.write out))
|
||||
(local state [])
|
||||
(local server {})
|
||||
(while true
|
||||
(let [msg (json-rpc.read in)]
|
||||
(dispatch.handle state send msg))))
|
||||
(dispatch.handle server send msg))))
|
||||
|
||||
(λ main []
|
||||
(case arg
|
||||
|
||||
@ -18,7 +18,7 @@ in the \"server\" object."
|
||||
(let [body (file:read :*a)]
|
||||
(file:close)
|
||||
body)
|
||||
(error (.. "failed to open file" uri)))))]
|
||||
(error (.. "failed to open file " uri)))))]
|
||||
{: uri : text}))
|
||||
|
||||
(λ get-by-uri [server uri]
|
||||
|
||||
@ -36,6 +36,11 @@
|
||||
"(let [x 0]
|
||||
(print x))"))
|
||||
|
||||
(fn test-fix-unused-definition []
|
||||
(check "(local x==== 10)"
|
||||
"unused-definition"
|
||||
"(local _x 10)"))
|
||||
|
||||
; (fn test-fix-method-function []
|
||||
; (check "(local x {})
|
||||
; (fn x:y [a b c]
|
||||
@ -45,4 +50,5 @@
|
||||
; (fn x.y [client a b c]
|
||||
; (print client a b c))"))
|
||||
|
||||
{: test-fix-op-no-arguments}
|
||||
{: test-fix-op-no-arguments
|
||||
: test-fix-unused-definition}
|
||||
|
||||
@ -1,14 +1,3 @@
|
||||
(local fennel (require :fennel))
|
||||
(set debug.traceback fennel.traceback)
|
||||
(local old-debug-getinfo debug.getinfo)
|
||||
(fn debug.getinfo [x]
|
||||
(let [{: sourcemap} (require :fennel.compiler)
|
||||
info (old-debug-getinfo (+ 1 x))]
|
||||
(when info
|
||||
(set info.currentline (or (?. sourcemap info.source info.currentline 2) info.currentline))
|
||||
(set info.linedefined (or (?. sourcemap info.source info.linedefined 2) info.linedefined)))
|
||||
info))
|
||||
|
||||
(local faith (require :faith))
|
||||
|
||||
(faith.run
|
||||
|
||||
@ -15,6 +15,6 @@
|
||||
"'")))
|
||||
" ")]
|
||||
(print (.. "running command: " command))
|
||||
(os.execute command)))
|
||||
(assert (os.execute command))))
|
||||
|
||||
{: sh}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user