jeffreykegler / yahc

Yet Another Hoon Compiler
MIT License
0 stars 1 forks source link

TISSIG: TISTIS anomalies? #27

Closed jeffreykegler closed 5 years ago

jeffreykegler commented 5 years ago

We previously encountered multiple TISTIS's on a line, and settled that such "criss-cross" TISTIS lines are OK, but nothing else is allowed on a line with a TISTIS. The TISSIG (=~) hoons break this rule a lot. Special-case them, or add to anomaly.suppressions?

My own inclination is to add them to anomaly.suppressions -- there does not seem to be a justification for a special case here. The relevant lint output follows.

tissig-tistis.lint.txt

ohAitch commented 5 years ago

Oof, looks like the thing it's doing is "unreanchoring", wherein the closing == is aligned with the opening =~ despite the intervening outdent. Criss-crossing is definitely the same thing modulo treating consecutive ==en as fungible, and I think "normal" long-form =~ also follows this pattern a lot:

  =~
|%
++  stuff
  here
--
|%
++  many
  arms
::
++  even  ~
--
  ==

Without the extra indent ofc, this is equivalent to "nothing else on the same line", because you can't use the \~same\~ position, putting something earlier on the line would syntactically violate indentation, and putting something later on the line would place it logically outside the =~. (Except once again crisis-cross which can cheat as described)

Verdict: check == for vertical(or horizontal) alignment, let other rules complain about things on the same line iff that would be silly?

jeffreykegler commented 5 years ago

I am replacing this with issue #33 and, accordingly, closing it.