Commit Graph

1205 Commits

Author SHA1 Message Date
Dianne Skoll ab03232341 Minor tweak 2025-05-24 23:15:51 -04:00
Dianne Skoll 51a65841cd Warn if a variable is UNSET without having been used (if -du is in effect) 2025-05-24 23:13:39 -04:00
Dianne Skoll 5035deaff1 Tweak warning wording; add tests. 2025-05-24 23:09:57 -04:00
Dianne Skoll 09caa8988a Add warning if we SET a variable that has already been set, but not used (if -du debug flag is set) 2025-05-24 23:06:50 -04:00
Dianne Skoll 9624b1045c Track filename and line number where variables are defined. 2025-05-24 22:58:28 -04:00
Dianne Skoll 102748397f Remove a couple of inappropriate "free" calls. 2025-05-24 22:58:16 -04:00
Dianne Skoll f852f7e7e5 Refactor conversion of "-" to "-stdin-" 2025-05-24 22:55:02 -04:00
Dianne Skoll 8d88192483 Keep a hash table of filenames we've seen so we don't need to strdup the current filename all over the place. 2025-05-24 22:51:16 -04:00
Dianne Skoll a6ca571fe5 Fix indentation. 2025-05-24 22:13:47 -04:00
Dianne Skoll af2daa7a87 Use "is_constant" attribute for Var to be consistent with UserFunc. 2025-05-24 10:10:44 -04:00
Dianne Skoll c5bc459dd9 Add "-du" debugging flag to print a list of variables that were set but never used. 2025-05-23 16:55:10 -04:00
Dianne Skoll edf26eaa14 Add more "const" debugging messages. 2025-05-23 13:38:38 -04:00
Dianne Skoll 7e5dc26ee5 *PROPERLY* disable RUN in eval. :) 2025-05-23 12:03:09 -04:00
Dianne Skoll 4c2b6031cd Disable shell() inside an eval("...") for safety.
Based on email from Tim Chase.
2025-05-23 11:48:06 -04:00
Dianne Skoll 0ec43d570c Add "const" function, which is the inverse of "nonconst" 2025-05-23 08:47:12 -04:00
Dianne Skoll f0f0cec2d3 Add $Tu == triguntil() system variable. 2025-05-22 18:00:24 -04:00
Dianne Skoll 70a97a8fe5 Add trigbase() built-in function. 2025-05-22 17:44:42 -04:00
Dianne Skoll 95b82a4457 "eval" can itself now be recursive, so we need to guard built-in functions against recursion. 2025-05-22 14:59:08 -04:00
Dianne Skoll 3118f8d2a4 Add "eval()" built-in function. 2025-05-22 13:52:07 -04:00
Dianne Skoll 357f7105bd Better coerce error messages. 2025-05-22 10:03:32 -04:00
Dianne Skoll b33a3191f5 Better nonconst diagnostic messages. 2025-05-22 09:38:06 -04:00
Dianne Skoll 1d3c1f006f Take care of some corner-cases of non-const tracking. 2025-05-22 09:35:18 -04:00
Dianne Skoll 633812d961 Add "-c" option to "dump" to show constness when dumping variables. 2025-05-21 23:43:40 -04:00
Dianne Skoll ec8cae6d4b Mark a few functions as non-const that were incorrectly marked const before. 2025-05-21 23:43:26 -04:00
Dianne Skoll 56e4f14a2f Don't use bitfields. They don't save space and are slower. 2025-05-21 13:42:06 -04:00
Dianne Skoll af5854d0c6 Improve diagnostic message. 2025-05-21 12:27:08 -04:00
Dianne Skoll de2d15009f Document all the non-constant tracking machinery. 2025-05-21 12:23:08 -04:00
Dianne Skoll 5d822e294d Make "Hush Mode" suppress all purge-mode diagnostics.
We only get the "#!P: Expired" lines in that case.
2025-05-21 11:15:56 -04:00
Dianne Skoll 1e3657b728 Overhaul how IF/ELSE work so we can track "constant-ness" of variables.
We now keep track of whether a variable holds a "constant" value
(ie, a value that will stay the same on successive Remind runs)
so Purge Mode can be more accurate.
2025-05-20 22:11:39 -04:00
Dianne Skoll a309af731f Minor code-formatting improvement. 2025-05-20 16:42:50 -04:00
Dianne Skoll e3a6c65983 Fix silly typo 2025-05-20 11:57:20 -04:00
Dianne Skoll 21904e708f Add "n" debugging flag to diagnose non-constant expressions. 2025-05-20 11:17:04 -04:00
Dianne Skoll e4a6a5cf01 Properly parse unary '+' operator. It's ignored, essentially. 2025-05-17 11:33:27 -04:00
Dianne Skoll 1be6ff23fb Optimmize away ! INT_CONSTANT. 2025-05-16 10:48:02 -04:00
Dianne Skoll 4db201945c Optimize "- INT_CONSTANT" to be simply -INT_CONSTANT rather than (- INT_CONSTANT) 2025-05-16 08:30:44 -04:00
Dianne Skoll 6aa217044b Implement wkdaynum("dayname") 2025-05-14 18:30:47 -04:00
Dianne Skoll c64d939237 Allow argument to monnum to be a string, in which case it's parsed as a month name. 2025-05-14 09:57:16 -04:00
Dianne Skoll 3fb1db0880 Add catcherr() built-in function. 2025-05-10 09:33:24 -04:00
Dianne Skoll a50f40d652 Don't use repeated DBG() macros. Instead, wrap everything in a conditional 2025-05-09 17:17:37 -04:00
Dianne Skoll a35de17b00 Add the "catch()" built-in function. 2025-05-09 17:09:00 -04:00
Dianne Skoll db31214060 Fix up year-folding logic. 2025-05-08 14:30:07 -04:00
Dianne Skoll ed7c5103ff Fold years so even 32-bit systems can handle astronomical stuff past 2038 2025-05-08 14:14:49 -04:00
Dianne Skoll 4590e746c5 Force year-folding on 32-bit time_t machines. 2025-05-08 12:10:15 -04:00
Dianne Skoll bc8ce3e2cc Change FoldArray to use years as close as possible to (but less than) 2038. 2025-05-08 11:56:53 -04:00
Dianne Skoll 66523b1b3b Use llabs instead of labs for systems that normally have 32-bit time_t
but are configured to use 64-bit time_t.
2025-05-06 12:36:43 -04:00
Dianne Skoll 59f978a9db Add $TimetIs64bit system variable. 2025-05-06 12:14:18 -04:00
Dianne Skoll 44b920e080 Make "remind -s" respect $DefaultColor
https://dianne.skoll.ca/pipermail/remind-fans/2025/005051.html
2025-04-23 10:15:20 -04:00
Dianne Skoll cef6e6717c Convert C++-style comments to C-style comments. 2025-03-24 11:42:54 -04:00
Dianne Skoll b9f09b9a2d Fix some cppcheck warnings. 2025-03-23 13:24:38 -04:00
Dianne Skoll ed15b7deb5 Update JSON parser to latest version from https://github.com/udp/json-parser 2025-03-22 12:09:30 -04:00