segment: Properly handle DO REPEAT in batch mode.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 23 Mar 2021 14:14:35 +0000 (07:14 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 23 Mar 2021 14:20:18 +0000 (07:20 -0700)
commit97313ef08d247c40e0f0a2d9b6ccfa1070ce651a
tree99d0ef89d52ef2c723c5920cea91a4bd32eb15ca
parentcd221d80fafb54e550398c6de105d4c1b7f02ba0
segment: Properly handle DO REPEAT in batch mode.

In batch mode, a line that begins with a non-blank starts a new command,
but the segmenter didn't properly support this.  Without this commit,
the following wasn't properly handled:

DO REPEAT #x=1
ECHO 'hi'
END REPEAT

This commit also adds a test against regression, which also checks that
a blank line to separate DO REPEAT from the repeated syntax works (it
did before too, but there was no test).
src/language/lexer/segment.c
tests/language/lexer/scan.at
tests/language/lexer/segment.at