bc: Improve print extension - sbase - suckless unix tools
 (HTM) git clone git://git.suckless.org/sbase
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 328295370ab688b83ce56034131a44f2f9426244
 (DIR) parent a360af6355f49472654954f5f6ddb43c1b3f1a17
 (HTM) 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:
         M bc.y                                |       2 ++
       
       1 file changed, 2 insertions(+), 0 deletions(-)
       ---
 (DIR) 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();}