update to fennel version 1.6.0

This commit is contained in:
XeroOl 2025-10-25 15:14:32 -05:00
parent 148d90a0ba
commit f5ae8f1803
13 changed files with 9012 additions and 5072 deletions

View File

@ -21,6 +21,7 @@
* Disabled by default because 0 *can* be a valid table key in some cases.
### Changes
* Updated to fennel 1.6.0
* Updated to dkjson 2.8
### Bug Fixes

2774
deps/fennel.lua vendored

File diff suppressed because one or more lines are too long

3029
fennel

File diff suppressed because one or more lines are too long

View File

@ -94,8 +94,7 @@ Run fennel-ls, the Fennel language server and linter.
(case arg
(where (or ["-h"] ["--help"])) (print help)
(where (or ["-v"] ["--version"])) (print version)
;; (where (or ["-l" & filenames] ["--lint" & filenames])) (lint filenames) ;; compile error in fennel <= 1.5.4
(where [--lint & filenames] (or (= --lint "--lint") (= --lint "-l"))) (lint-files filenames)
(where (or ["-l" & filenames] ["--lint" & filenames])) (lint-files filenames)
(where (or ["--server"] [nil])) (main-loop (io.input)
(io.output))
["--fix" "-y" & filenames] (fix-files filenames true)

View File

@ -356,7 +356,7 @@ identifiers are declared / referenced in which places."
extra-global))
plugin
{:name "fennel-ls"
:versions ["1.4.1" "1.4.2" "1.5.0" "1.5.1" "1.5.3" "1.5.4"]
:versions ["1.4.1" "1.4.2" "1.5.0" "1.5.1" "1.5.3" "1.5.4" "1.6.0"]
: symbol-to-expression
: call
: destructure

View File

@ -1,91 +1,152 @@
{:assert-compile {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["condition"
"msg"
"ast"
"?fallback-ast"]
:fnl/docstring "Assert a condition and raise a compile error with line numbers.
{:assert-compile
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["condition" "msg" "?ast" "?fallback-ast"]
:fnl/docstring
"Assert a condition and raise a compile error with line numbers.
The ast arg should be unmodified so that its first element is the form called."}}
:ast-source {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["ast"]
:fnl/docstring "Get a table for the given ast which includes file/line info, if possible."}}
:comment {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["contents" "?source"]}}
:comment? {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x"]}}
:fennel-module-name {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist []}}
:gensym {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["base"]}}
:get-scope {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist []}}
:in-scope? {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["symbol"]}}
:list {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["..."]
:fnl/docstring "Create a new list. Lists are a compile-time construct in Fennel; they are
:ast-source
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["ast"]
:fnl/docstring
"Get a table for the given ast which includes file/line info, if possible."}}
:comment
{:metadata
{:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["contents" "?source"]}}
:comment?
{:metadata {:fls/fntype "fn" :fls/itemKind "Function" :fnl/arglist ["x"]}}
:fennel-module-name
{:metadata {:fls/fntype "fn" :fls/itemKind "Function" :fnl/arglist []}}
:gensym
{:metadata {:fls/fntype "fn" :fls/itemKind "Function" :fnl/arglist ["base"]}}
:get-scope
{:metadata {:fls/fntype "fn" :fls/itemKind "Function" :fnl/arglist []}}
:in-scope?
{:metadata {:fls/fntype "fn" :fls/itemKind "Function" :fnl/arglist ["symbol"]}}
:list
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["..."]
:fnl/docstring
"Create a new list. Lists are a compile-time construct in Fennel; they are
represented as tables with a special marker metatable. They only come from
the parser, and they represent code which comes from reading a paren form;
they are specifically not cons cells."}}
:list? {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x"]
:fnl/docstring "Checks if an object is a list. Returns the object if is."}}
:macro-loaded {:fields {}}
:macroexpand {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["form"]}}
:multi-sym? {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["str"]
:fnl/docstring "Returns a table containing the symbol's segments if passed a multi-sym.
:list?
{:metadata
{:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x"]
:fnl/docstring "Checks if an object is a list. Returns the object if is."}}
:macro-loaded
{:fields {}}
:macroexpand
{:metadata {:fls/fntype "fn" :fls/itemKind "Function" :fnl/arglist ["form"]}}
:multi-sym?
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["str"]
:fnl/docstring
"Returns a table containing the symbol's segments if passed a multi-sym.
A multi-sym refers to a table field reference like tbl.x or access.channel:deny.
Returns nil if passed something other than a multi-sym."}}
:pack {}
:sequence {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["..."]
:fnl/docstring "Create a new sequence. Sequences are tables that come from the parser when
:pack
{}
:sequence
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["..."]
:fnl/docstring
"Create a new sequence. Sequences are tables that come from the parser when
it encounters a form with square brackets. They are treated as regular tables
except when certain macros need to look for binding forms, etc specifically."}}
:sequence? {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x"]
:fnl/docstring "Checks if an object is a sequence (created with a [] literal)"}}
:sym {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["str" "?source"]
:fnl/docstring "Create a new symbol. Symbols are a compile-time construct in Fennel and are
:sequence?
{:metadata
{:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x"]
:fnl/docstring "Checks if an object is a sequence (created with a [] literal)"}}
:sym
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["str" "?source"]
:fnl/docstring
"Create a new symbol. Symbols are a compile-time construct in Fennel and are
not exposed outside the compiler. Second optional argument is a table describing
where the symbol came from; should be a table with filename, line, bytestart,
and byteend fields."}}
:sym? {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x" "?name"]
:fnl/docstring "Checks if an object is a symbol. Returns the object if it is.
:sym?
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["x" "?name"]
:fnl/docstring
"Checks if an object is a symbol. Returns the object if it is.
When given a second string argument, will check that the sym's name matches it."}}
:table? {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x"]
:fnl/docstring "Checks if an object any kind of table, EXCEPT list/symbol/varg/comment."}}
:unpack {}
:varg? {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x"]
:fnl/docstring "Checks if an object is the varg symbol. Returns the object if is."}}
:version {:definition "1.5.3"}
:view {:metadata {:fls/fntype "fn"
:fls/itemKind "Function"
:fnl/arglist ["x" "?options"]
:fnl/docstring "Return a string representation of x.
:table?
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["x"]
:fnl/docstring
"Checks if an object any kind of table, EXCEPT list/symbol/varg/comment."}}
:unpack
{}
:varg?
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["x"]
:fnl/docstring
"Checks if an object is the varg symbol. Returns the object if is."}}
:version
{:definition "1.6.0"}
:view
{:metadata
{:fls/fntype
"fn"
:fls/itemKind
"Function"
:fnl/arglist
["x" "?options"]
:fnl/docstring
"Return a string representation of x.
Can take an options table with the following keys:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -659,9 +659,8 @@ You can read more about how to add lints in docs/linting.md"
;; exception: (/ a b) only needs 1 argument
min-params (if (= result (docs.get-builtin server :-)) 1
(= result (docs.get-builtin server :/)) 1
;; TODO Fennel 1.5.4+ has `fn`'s arglist fixed
;; exception: fn only needs one argument
(= result (docs.get-builtin server :fn)) 1
(= result (docs.get-builtin server :fn)) (if (table? (. ast 2)) 1 2)
;; TODO: collect arglist is still broken upstream
(= result (docs.get-builtin server :collect)) 2
(or (accumulate [last-required-param nil
i arg (ipairs signature)

View File

@ -17,7 +17,7 @@
[{: result}] (client:signature-help uri cursor)]
(check-signature expected result)))
(local fn-signature "(fn name? args docstring? ...)")
(local fn-signature "(fn ?name args ?docstring ...)")
(local fn-params [{:label [4 9]}
{:label [10 14]}
{:label [15 25]}
@ -186,9 +186,9 @@
:parameters fn-params}))
(fn test-binding-form []
(local each-signature "(each [key value (iterator)] ...)")
(local each-params [{:label [6 28]}
{:label [29 32]}])
(local each-signature "(each [vals... iterator] ...)")
(local each-params [{:label [6 24]}
{:label [25 28]}])
(check "(each |)"
{:signature each-signature

View File

@ -6,7 +6,7 @@
(sh :git :clone :-c :advice.detachedHead=false :--depth=1 url location)))
;; Vendored Dependency Versions
(local fennel-version "1.5.3")
(local fennel-version "1.6.0")
(local faith-version "0.2.0")
(local penlight-version "1.14.0")
(local dkjson-version "2.8")