From 48dcfd22f9c2db5cf6745eaec0ff28895858c638 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 21 Jul 2025 00:19:52 +0300 Subject: support <==> and <===> for printing octal and hexadecimal numbers * These are famously in DEC TECO-11, but also in Video TECO. * The implementation is tricky. They need to use lookahead states, but this would be inacceptable during interactive execution. Therefore only if executing from the end of the command line `==` and `===` are allowed to print multiple values. The number is therefore also not popped form the stack immediately but only peeked. It's popped only when it has been decided that the command has ended. * This may break existing macros that use multiple `=` in a row to print multiple values from the stack. You will now e.g. have to insert whitespace to separate such `=` commands. --- src/sciteco.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/sciteco.h') diff --git a/src/sciteco.h b/src/sciteco.h index 2dc4749..40a3548 100644 --- a/src/sciteco.h +++ b/src/sciteco.h @@ -25,10 +25,12 @@ #if TECO_INTEGER == 32 typedef gint32 teco_int_t; -#define TECO_INT_FORMAT G_GINT32_FORMAT +#define TECO_INT_MODIFIER G_GINT32_MODIFIER +#define TECO_INT_FORMAT G_GINT32_FORMAT #elif TECO_INTEGER == 64 typedef gint64 teco_int_t; -#define TECO_INT_FORMAT G_GINT64_FORMAT +#define TECO_INT_MODIFIER G_GINT64_MODIFIER +#define TECO_INT_FORMAT G_GINT64_FORMAT #else #error Invalid TECO integer storage size #endif -- cgit v1.2.3