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>
Thu, 14 Feb 2019 13:40:57 +0000 (14:40 +0100)
commit715273a992edb0943fdffb9bc9bb9b506de9f7de
treebb407aa69eaf53ee51abac9a695acfaee684be23
parenta89ec68a8a62bbdc3e795057ec12423c86990de2
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