sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit 328295370ab688b83ce56034131a44f2f9426244
parent a360af6355f49472654954f5f6ddb43c1b3f1a17
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Wed, 26 Nov 2025 09:17:41 +0100

bc: Improve print extension

While debugging bc programs it is very convinient to be able to
print a string in the same line than an expression, in the same
way that printing strings alone.

Diffstat:
Mbc.y | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/bc.y b/bc.y @@ -130,6 +130,8 @@ statlst : {$$ = code("");} stat : exprstat | PRINT expr {$$ = code("%sps.", $2);} + | PRINT STRING {$$ = code("[%s]P", $2);} + | PRINT STRING ',' expr {$$ = code("[%s]P%sps.", $2, $4);} | STRING {$$ = code("[%s]P", $1);} | BREAK {$$ = brkcode();} | QUIT {quit();}