]> ocean-lang.org Git - ocean/commitdiff
scanner: improve transition from node to node.
authorNeilBrown <neil@brown.name>
Sat, 8 Jun 2019 23:42:05 +0000 (09:42 +1000)
committerNeilBrown <neil@brown.name>
Sat, 8 Jun 2019 23:56:51 +0000 (09:56 +1000)
When we are at the end of a node, it is wrong to use do_strip() as
that looks beyond the end of the node.
It is better, once we have determined to accept the newline at the
end of a node (i.e. once no unget is possible), to move to the
start of the next node, and assess column position and indents from
that perspective.
Do this removes some tests on at_son/at_eon, and make some code a
bit more transparent - for example the flag that say whether an "out"
is next now depends on where a newline was recently seen, which makes
more sense than whether we were at the start of a node (out and newline
alternate in some contexts).

Also: add the test which found this problem.   This requires a
new set of tests - tests which can scan tokens from multiple nodes.

Now that we are testing node transitions, the coverage has jumped
over 92%

Signed-off-by: NeilBrown <neil@brown.name>

No differences found