eed31639d5de5bfbaa1f743a680b3b0b98cc1fc8 — Josef Pospíšil 8 months ago 7a054af
Remove project.janet from compile
2 files changed, 11 insertions(+), 2 deletions(-)

M jlnt
M README.md => README.md +8 -0
@@ 1,3 1,11 @@
# Janet Linter for Kakoune

Simple linter for Janet programming language in Kakoukne editor.

# Usage

Just run the cmd with the filename you want to lint, `jlnt filename` and it will
print all the offending lines in the file in the Kakoune lint format.

That's it. I guess it won't be that hard to change to other tool format, it is
just printf.

M jlnt => jlnt +3 -2
@@ 1,6 1,7 @@
#!/usr/bin/env janet

(defn main [_ file]
  (def c (= file "project.janet"))
  (def src (slurp file))
  (def lines (length (peg/find-all "\n" src)))
  (def p (parser/new))

@@ 10,11 11,11 @@
      (var [l c] (:where p))
      (when (> l lines) (set l lines) (set c 1))
      (printf "%s:%i:%i: %s: %s" file l c "error" (:error p)))
    (unless c
      (:eof p)
      (while (:has-more p)
        (def pr (:produce p))
        (def cr (compile pr (fiber/getenv (fiber/current))))
        (def cr (compile pr))
        (if (function? cr)
          (if (= (pr 0) 'import) (cr))