Continue-parsing-on-next-line in Spin2
I want to add a way to continue parsing Spin2 code on the next line. Sometimes this is useful for making code more readable or just keeping line lengths down.
Here is what I am thinking about:
k := byte[Bp(i)].[7..5] << 3 | ... 'get lifecycle of this block byte[Bp(j)].[7..5] 'and other block
The '...' tells the parser to ignore the rest of the line and continue parsing from the start of the next line. This does not reset the column counter for indention measurements which affect scope.
So, does '...' look best or does '``' look better?
k := byte[Bp(i)].[7..5] << 3 | `` 'get lifecycle of this block byte[Bp(j)].[7..5] 'and other block
I kind of like the latter more.
This happens at the lowest level of the parser, so it would work for all code, including PASM.
I had started out thinking about just having rules for when things could continue on the next line, like after a comma, but then there are needs to break lines at many points. Rather than make a bunch of rules for when lines could continue on the next line, which could really complicate highlighters (not to mention the compiler), I figured some simple character combo to signal continue-on-next-line would keep things simplest.