]> ocean-lang.org Git - ocean/commit
indent_test: reduce stack usage for preceding NEWLINEs
authorNeilBrown <neil@brown.name>
Sun, 23 Jun 2019 03:51:46 +0000 (13:51 +1000)
committerNeilBrown <neil@brown.name>
Sun, 23 Jun 2019 03:51:46 +0000 (13:51 +1000)
commit1755b9a1a4070502f4a46ba1f4accc6f9feb7fd4
treebb4f363c419443ae00a27c7b94d398dd764dc0b5
parent35d743c48140ea96fa56c3f63ee8dd0e032cbb2d
indent_test: reduce stack usage for preceding NEWLINEs

In the cases where we allow preceding newlines (Statementlist Open Close)
we current use one parse-stack from for each newline.  While there are
unlikely to be many, this is inelegant.
Change the right-recursive form to use a left-recursive Newlines rule
that absorbs one or more NEWLINEs using at most 2 stack frames.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/indent_test.mdc