bc: disallow invalid syntax like "{ print 1 print 2 }"
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 8 Jan 2019 17:08:48 +0000 (18:08 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 8 Jan 2019 17:10:00 +0000 (18:10 +0100)
commitfc7aa7a296cf13d13aae5457f4f7cd2b73700234
tree322b3d74f6664b18ed29b72a251e16783cf99e5c
parentce51140664d82300d25b096b4a41f01fdfd766b3
bc: disallow invalid syntax like "{ print 1 print 2 }"

statement parsing must NOT eat the terminator: caller needs to know
what it was, to correctly decide whether it is a valid one.

function                                             old     new   delta
zxc_program_read                                       -     234    +234
zdc_program_printStream                                -     144    +144
zbc_parse_stmt_possibly_auto                        1413    1460     +47
zxc_vm_process                                       869     859     -10
zxc_program_exec                                    4116    4101     -15
zdc_program_asciify                                  368       -    -368
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 1/2 up/down: 425/-393)           Total: 32 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/bc.c