workaround for fennel#221

This commit is contained in:
XeroOl 2024-05-14 00:46:10 -05:00
parent e37c77958d
commit 3dc9e36af6
2 changed files with 3 additions and 1 deletions

View File

@ -343,7 +343,8 @@ identifiers are declared / referenced in which places."
(λ parsed [ast]
"runs on every ast tree that was parsed"
(if (sym? ast)
;; TODO in fennel 1.5+, bug fennel#221 will be fixed, and all syms in the ast should have a bytestart
(if (and (sym? ast) ast.bytestart)
(case (values (tostring ast) (file.text:sub ast.bytestart ast.bytestart))
(where (:hashfn "#"))
(table.insert defer #(set ast.byteend ast.bytestart))

View File

@ -39,6 +39,7 @@
(create-client-with-files "(macro foo {} nil)
(λ test {} nil)
(λ {} nil")
(create-client-with-files "(fn foo []\n #\n (print :test))")
nil)
(fn test-split-spaces []