~ambrosebs

Trackers

~ambrosebs/typedclojure

Last active 3 years ago

#159 Incorrect "one body" error form with certain indentation 11 months ago

Ticket created by ~ambrosebs on ~technomancy/fennel

These errors are reproducible with {f}accumulate and icollect.

Using if-style indentation, the wrong form is blamed when two lists are provided as body to `faccumulate:

(if
  1 (faccumulate [_ []
                 _ _ (ipairs [])]
      (when nil nil)
      (table.insert acc frm)))

./fennel --compile reprod.fnl
reprod.fnl:2:4 Compile error: src/fennel/macros.fnl:176: expected exactly one body expression. Wrap multiple expressions with do

  1

When evaluated by itself, there is no form printed when providing two lists as body:

(faccumulate [_ []
              _ _ (ipairs [])]
  (when nil nil)
  (table.insert acc frm))

./fennel --compile reprod.fnl
reprod.fnl:1:0 Compile error: src/fennel/macros.fnl:176: expected exactly one body expression. Wrap multiple expressions with do