From 8a5b88338b107a4edf3dfcf783a3ff21411307b6 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Sun, 8 Sep 2024 10:29:49 -0400 Subject: [PATCH] Add --print-tokens long option to dump Remind tokens to stdout. --- src/funcs.c | 10 ++++++++++ src/init.c | 6 ++++++ src/protos.h | 5 +++++ src/token.c | 54 +++++++++++++++++++++++++++++++++++++++++++++------- src/var.c | 9 +++++++++ 5 files changed, 77 insertions(+), 7 deletions(-) diff --git a/src/funcs.c b/src/funcs.c index 8ef03036..a574ce39 100644 --- a/src/funcs.c +++ b/src/funcs.c @@ -4005,3 +4005,13 @@ BuiltinFunc *FindBuiltinFunc(char const *name) } return NULL; } + +void +print_builtinfunc_tokens(void) +{ + int i; + printf("\n# Built-in Functions\n\n"); + for (i=0; iMinLen < (int) strlen(tok->name)) { + printf("%.*s\n", tok->MinLen, tok->name); + } + printf("%s\n", tok->name); +} + +void +print_remind_tokens(void) +{ + int i; + Token *tok; + int num = (int) (sizeof(TokArray) / sizeof(TokArray[0])); + printf("# Remind Tokens\n\n"); + for (i=0; itype != T_Month && tok->type != T_WkDay) { + print_token(tok); + } + } + + printf("\n# Month Names\n\n"); + for (i=0; itype == T_Month) { + print_token(tok); + } + } + + printf("\n# Weekdays\n\n"); + for (i=0; itype == T_WkDay) { + print_token(tok); + } + } +} diff --git a/src/var.c b/src/var.c index 5a48452d..7d51414e 100644 --- a/src/var.c +++ b/src/var.c @@ -1198,3 +1198,12 @@ set_components_from_lat_and_long(void) } } +void +print_sysvar_tokens(void) +{ + int i; + printf("\n# System Variables\n\n"); + for (i=0; i< (int) NUMSYSVARS; i++) { + printf("$%s\n", SysVarArr[i].name); + } +}