Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Olical committed Apr 9, 2022
2 parents 0c85b2e + 7972152 commit 422cadf
Show file tree
Hide file tree
Showing 26 changed files with 173 additions and 136 deletions.
1 change: 1 addition & 0 deletions .fs.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is here to test some filesystem related things.
14 changes: 7 additions & 7 deletions fnl/conjure/eval.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
2 (. range.end 2)}]

(vim.highlight.range
bufnr
namespace
(config.get-in [:highlight :group])
hl_start
hl_end
:v
true)
bufnr namespace (config.get-in [:highlight :group]) hl_start hl_end
(unpack
;; https://github.com/neovim/neovim/issues/14090#issuecomment-1047205812
(if (= 1 (nvim.fn.has "nvim-0.7"))
[{:regtype :v
:inclusive true}]
[:v true])))

(timer.defer
(fn []
Expand Down
28 changes: 11 additions & 17 deletions fnl/conjure/fs.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,22 @@
(join-path))]
(if (= "" res)
nil
;; TODO: Needs to be Windows compatible?
(.. "/" res))))
(.. afs.path-sep res))))

(defn upwards-file-search [orig-names orig-dir]
(defn upwards-file-search [file-names from-dir]
"Given a list of relative filenames and an absolute path to a directory,
return the absolute path of the first file that matches a relative path,
starting at the directory and then upwards towards the root directory. If no
match is found, return nil."
(var names orig-names)
(var dir orig-dir)
(var file nil)
(while (and dir (not file))
(let [name (a.first names)]
(if name
(let [res (findfile name dir)]
(if res
(set file res)
(set names (a.rest names))))
(do
(set names orig-names)
(set dir (parent-dir dir))))))
file)

(when (and from-dir (not (a.empty? file-names)))
(let [result (a.some
(fn [file-name]
(findfile file-name from-dir))
file-names)]
(if result
result
(upwards-file-search file-names (parent-dir from-dir))))))

(defn resolve-above [names]
"Resolve a pathless list of file names to an absolute path by looking in the
Expand Down
1 change: 1 addition & 0 deletions fnl/conjure/sponsors.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"davidmh"
"dharrigan"
"djwhitt"
"Fedreg"
"frenchy64"
"fuadsaud"
"harrygallagher4"
Expand Down
6 changes: 3 additions & 3 deletions lua/conjure/aniseed/deps/fennel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ package.preload["conjure.aniseed.fennel.repl"] = package.preload["conjure.anisee
_571_ = _572_
end
end
if ((_G.type(_571_) == "table") and ((_571_).what == "Lua") and (nil ~= (_571_).linedefined) and (nil ~= (_571_).source) and (nil ~= (_571_).short_src)) then
local line = (_571_).linedefined
if ((_G.type(_571_) == "table") and (nil ~= (_571_).source) and (nil ~= (_571_).linedefined) and ((_571_).what == "Lua") and (nil ~= (_571_).short_src)) then
local source = (_571_).source
local line = (_571_).linedefined
local src = (_571_).short_src
local fnlsrc
do
Expand Down Expand Up @@ -3456,7 +3456,7 @@ package.preload["conjure.aniseed.fennel.parser"] = package.preload["conjure.anis
end
end
local function escape_char(c)
return ({nil, nil, nil, nil, nil, nil, "\\a", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r"})[c:byte()]
return ({[7] = "\\a", [8] = "\\b", [9] = "\\t", [10] = "\\n", [11] = "\\v", [12] = "\\f", [13] = "\\r"})[c:byte()]
end
local function parse_string()
table.insert(stack, {closer = 34})
Expand Down
4 changes: 2 additions & 2 deletions lua/conjure/aniseed/macros.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@
(tset ,mod-sym ,(tostring name) ,name)])

(fn defonce- [name value]
`(def- ,name (or ,name ,value)))
`(def- ,name (or (. ,mod-sym ,(tostring name)) ,value)))

(fn defonce [name value]
`(def ,name (or ,name ,value)))
`(def ,name (or (. ,mod-sym ,(tostring name)) ,value)))

(fn deftest [name ...]
`(let [tests# (or (. ,mod-sym :aniseed/tests
Expand Down
6 changes: 3 additions & 3 deletions lua/conjure/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ local state_key
local function _1_()
return "default"
end
state_key = (__fnl_global__state_2dkey or dyn.new(_1_))
state_key = ((_2amodule_2a)["state-key"] or dyn.new(_1_))
do end (_2amodule_2a)["state-key"] = state_key
local state = (state or {["state-key-set?"] = false})
local state = ((_2amodule_2a).state or {["state-key-set?"] = false})
do end (_2amodule_locals_2a)["state"] = state
local function set_state_key_21(new_key)
state["state-key-set?"] = true
Expand Down Expand Up @@ -56,7 +56,7 @@ local function new_state(init_fn)
return _3_
end
_2amodule_2a["new-state"] = new_state
local loaded = (loaded or {})
local loaded = ((_2amodule_2a).loaded or {})
do end (_2amodule_locals_2a)["loaded"] = loaded
local function load_module(ft, name)
local fnl = fennel.impl()
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/client/clojure/nrepl/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ local get
local function _1_()
return {conn = nil, ["auto-repl-proc"] = nil, ["join-next"] = {key = nil}}
end
get = (get or client["new-state"](_1_))
get = ((_2amodule_2a).get or client["new-state"](_1_))
do end (_2amodule_2a)["get"] = get
return _2amodule_2a
2 changes: 1 addition & 1 deletion lua/conjure/client/common-lisp/swank.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local state
local function _1_()
return {conn = nil}
end
state = (state or client["new-state"](_1_))
state = ((_2amodule_2a).state or client["new-state"](_1_))
do end (_2amodule_locals_2a)["state"] = state
local function with_conn_or_warn(f, opts)
local conn = state("conn")
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/client/fennel/aniseed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ local function anic(mod, f_name, ...)
return ani(mod, f_name)(...)
end
_2amodule_locals_2a["anic"] = anic
local repls = (repls or {})
local repls = ((_2amodule_2a).repls or {})
do end (_2amodule_locals_2a)["repls"] = repls
local function reset_repl(filename)
local filename0 = (filename or fs["localise-path"](extract["file-path"]()))
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/client/fennel/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ local state
local function _1_()
return {repl = nil}
end
state = (state or client["new-state"](_1_))
state = ((_2amodule_2a).state or client["new-state"](_1_))
do end (_2amodule_locals_2a)["state"] = state
local buf_suffix = ".fnl"
_2amodule_2a["buf-suffix"] = buf_suffix
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/client/guile/socket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local state
local function _1_()
return {repl = nil}
end
state = (state or client["new-state"](_1_))
state = ((_2amodule_2a).state or client["new-state"](_1_))
do end (_2amodule_locals_2a)["state"] = state
local buf_suffix = ".scm"
_2amodule_2a["buf-suffix"] = buf_suffix
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/client/hy/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local state
local function _1_()
return {repl = nil}
end
state = (state or client["new-state"](_1_))
state = ((_2amodule_2a).state or client["new-state"](_1_))
do end (_2amodule_locals_2a)["state"] = state
local buf_suffix = ".hy"
_2amodule_2a["buf-suffix"] = buf_suffix
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/client/janet/netrepl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local state
local function _1_()
return {conn = nil}
end
state = (state or client["new-state"](_1_))
state = ((_2amodule_2a).state or client["new-state"](_1_))
do end (_2amodule_locals_2a)["state"] = state
local function with_conn_or_warn(f, opts)
local conn = state("conn")
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/client/racket/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ local state
local function _1_()
return {repl = nil}
end
state = (state or client["new-state"](_1_))
state = ((_2amodule_2a).state or client["new-state"](_1_))
do end (_2amodule_locals_2a)["state"] = state
local buf_suffix = ".rkt"
_2amodule_2a["buf-suffix"] = buf_suffix
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/client/scheme/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ local state
local function _1_()
return {repl = nil}
end
state = (state or client["new-state"](_1_))
state = ((_2amodule_2a).state or client["new-state"](_1_))
do end (_2amodule_locals_2a)["state"] = state
local buf_suffix = ".scm"
_2amodule_2a["buf-suffix"] = buf_suffix
Expand Down
Loading

0 comments on commit 422cadf

Please sign in to comment.