Commit Graph

152 Commits

Author SHA1 Message Date
Dianne Skoll 129bf5612e Refactor some code. 2024-06-03 19:43:28 -04:00
Dianne Skoll 829962fae1 We don't need to check for excessive parse depth if we're not at the high water mark. 2024-06-03 19:35:42 -04:00
Dianne Skoll 0e010b56ec Fix some error messages. 2024-06-03 17:59:11 -04:00
Dianne Skoll 8f0a2a7e79 Limit parse high-water to 2000 2024-06-03 15:15:58 -04:00
Dianne Skoll ef23bba77f Track parse level high-water mark. 2024-06-03 15:13:32 -04:00
Dianne Skoll 602086ae2d Make "-ds" show built-in functions with ucfirst and user-defined ones all lower-case. 2024-06-03 14:56:32 -04:00
Dianne Skoll eb109bbbc0 Finish commenting expr.c 2024-06-03 10:01:38 -04:00
Dianne Skoll 09625b9d68 More docs 2024-06-02 23:07:49 -04:00
Dianne Skoll 4e164c4268 More comments. 2024-06-02 21:08:04 -04:00
Dianne Skoll a8bfb41a9e Add $ExpressionTimeLimit system variable. 2024-06-02 14:01:17 -04:00
Dianne Skoll b49c0f52bd Implement EXPR ON and EXPR OFF 2024-06-02 12:39:00 -04:00
Dianne Skoll d77d9854d2 Remove src/expr.h - everything in it is now in types.h or protos.h 2024-06-02 10:26:41 -04:00
Dianne Skoll 5e016768af More comments. 2024-06-02 09:46:53 -04:00
Dianne Skoll ee08ce98d7 More comments. 2024-06-01 23:33:33 -04:00
Dianne Skoll bb92dab1ab More docs. 2024-06-01 16:44:37 -04:00
Dianne Skoll 83b5c52c76 Make parse_expr_token much any following whitespace to replicate prior behavior.
There may be other parts of the code that rely on this.
2024-06-01 16:35:20 -04:00
Dianne Skoll 29b87898aa Add some ASCII art 2024-06-01 14:00:39 -04:00
Dianne Skoll e9e4db94bd More comments 2024-06-01 13:44:21 -04:00
Dianne Skoll c95ad0261a Start adding comments; do not distinguish between N_BINARY_OPERATOR and N_UNARY_OPERATOR 2024-06-01 13:37:58 -04:00
Dianne Skoll 7fef456483 Don't allocate - nodes if we don't need to 2024-06-01 13:23:52 -04:00
Dianne Skoll 386131e74d Show bytes used for expression notes. 2024-06-01 09:45:37 -04:00
Dianne Skoll 824d3c88f1 Store at most 5 function args on stack. Any more and we malloc. 2024-06-01 09:41:26 -04:00
Dianne Skoll 18a206abd2 Store args on stack if possible. 2024-06-01 09:30:42 -04:00
Dianne Skoll 8dbae776c9 Fix SEGV. 2024-06-01 09:27:27 -04:00
Dianne Skoll b78702cc53 Assume all function names are lower-case. 2024-06-01 08:46:27 -04:00
Dianne Skoll d2b43605ad Completely revamp expression engine. 2024-06-01 08:19:12 -04:00
Dianne Skoll 61fcc1b275 Add "s" debugging flag to see expression-parsing stack high-water marks.
Reduce default value stack size from 1000 to 100.
2024-03-13 12:06:55 -04:00
Dianne Skoll 25b7a40f2b Try hard to avoid integer overflow. 2024-02-03 16:30:39 -05:00
Dianne Skoll 2beaab1a2f More checks on INT * STRING plus a man page note. 2024-02-03 16:29:05 -05:00
Dianne Skoll 60793d53c6 Don't use O(N^2) algorithm for STR * INT 2024-02-03 16:12:54 -05:00
Dianne Skoll b2bd6109dc Allow STRING * INT or INT * STRING, which repeats STRING that many times. 2024-02-03 16:00:23 -05:00
Dianne Skoll 72d10178bf Mass-update copyright year to 2024. 2023-12-31 12:05:03 -05:00
Dianne Skoll 18f21693af Clean up some warnings from cppcheck static analyzer. 2023-02-07 10:28:02 -05:00
Dianne Skoll 2f196e3c9f Update copyright year. :) 2022-12-30 13:43:28 -05:00
Dianne Skoll 0cea410529 Add a bunch of: "SPDX-License-Identifier: GPL-2.0-only" comments. 2022-12-26 14:24:33 -05:00
Dianne Skoll 4aacf74e25 More renaming of jul -> dse 2022-12-21 13:35:12 -05:00
Dianne Skoll 387125d983 Start fixing terminology: Julian becomes DSE
Remind's so-called "Julian" date is not a true Julian date.
It's really the number of days since the Remind Epoch, so rename
to DSE (Days Since Epoch)
2022-12-21 13:14:00 -05:00
Dianne Skoll c8f9773d83 Speed up FindFunc. 2022-10-14 13:53:50 -04:00
Dianne Skoll 914f03d5eb Fix bad comment. 2022-10-14 11:45:04 -04:00
Dianne Skoll fde5a7b4ca Can use strcmp rather than StrCmpI in FindOperator since they are not alphabetic 2022-10-14 11:41:11 -04:00
Dianne Skoll 9d68134f0f Make PrintValue escape only byte values < 32 2022-10-09 17:53:40 -04:00
Dianne Skoll 7218d55f08 Add $TerminalBackground special variable. 2022-10-09 12:40:48 -04:00
Dianne Skoll 18043080ba Properly detect missing quote after escape sequence. 2022-09-23 20:42:57 -04:00
Dianne Skoll 7cd8cf3a77 Dump strings more sensibly in PrintValue. 2022-09-23 19:10:36 -04:00
Dianne Skoll de5d1347e5 Make the operator stack static 2022-03-26 19:05:18 -04:00
Dianne Skoll e651f92bd9 Make tests pass even if we use LTO. 2022-03-22 09:17:31 -04:00
Dianne Skoll 4d17494371 Bump copyright date. 2022-03-14 21:12:20 -04:00
Dianne Skoll 89173ce1ee Allow logical operators to accept any non-string operands.
Make wouldtrig() return a date.
2022-03-04 14:59:17 -05:00
Dianne Skoll 6274cbad52 Make || return first true val and && return last val if first val is true. 2022-03-04 12:11:25 -05:00
Dianne Skoll b758a2fea8 Tweak formatting. 2022-03-04 11:40:46 -05:00