aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-06-21core: improve eval frame handlingSteve Bennett3-119/+70
Now callers to JimInvokeCommand() are expected to push and eval frame. Then we no longer need to carry currentScriptObj, argc, argv in the interp since these are in the current eval frame. Note that this change simply renames some unused fields in Jim_Interp for ABI compatibility, but these will be removed in due course. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-06-20file: use 64 bit stat functions if necessarySteve Bennett3-7/+31
Some 32 bit systems may require explicit use of stat64, etc. Fixes #263
2023-05-25docs: document multi-level break, continueSteve Bennett1-5/+26
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-05-25tests: for multi-level break, continueSteve Bennett1-0/+127
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-05-25core: support multi-level while, break from loopsSteve Bennett2-23/+76
loop i 5 { loop j 6 { # This breaks out of both loops break 2 } } Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-05-09core: avoid rare crash on shutdownSteve Bennett1-14/+11
If deferred commands run on shutdown as stack frames are unwound, it is possible that a command is deleted but a later command still has a reference to it. So instead of trying to optimise this case by freeing immediately, cache deleted commands and let the be freed once all stack frames are destroyed. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-05-07jim-sqlite3: remove unused variable, rowsSteve Bennett1-3/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-05-06rlprompt.tcl: Update comment instructionsSteve Bennett1-1/+1
At some point $jim_interactive changed to the Tcl-compatible $tcl_interactive Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-05-06jim: info frame improvementsSteve Bennett5-57/+93
always include 'proc' even if introspection disabled correctly set 'proc' at the eval frame level that is currently running in the given proc. This makes it easier to produce an accurate level stacktrace even across uplevel, etc. Update stacktrace to use the new info frame. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-04-19regexp: fix incorrect check for invalid escape sequence at end of charsetSteve Bennett2-1/+5
Fixes #259 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-04-19regexp: fix check for termination in [[:class:]]Steve Bennett2-0/+8
Fixes #259 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-04-19vwait: Fix an arg problem with -signalSteve Bennett1-1/+1
'vwait -signal done' should wait for variable 'done' to change but instead waits for a variable '-signal' to changed. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-04-13stacktrace: handle missing cmd in [info frame]Steve Bennett1-1/+1
Some stack frames may have no cmd (e.g. with eval). Ensure that [stacktrace] still handles such frames by setting an empty proc name in that case. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-03-20Add support for ./configure --disable-introspectionSteve Bennett3-13/+39
Sometimes it can be useful to provide an embedded interpreter where introspection is not permitted. This includes: - info commands, procs, channels: only allow exact match, not glob pattern - info frame: don't include cmd and proc in the returned dict - info level: only return the command name, not the command arguments - info body, args, statics: do not allow these to be called Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-03-20build: allow build without math functionsSteve Bennett1-4/+7
if sin(), etc. aren't available, just build without math functions unless --math is explicitly given Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-03-20build: define _GNU_SOURCE only on the command lineSteve Bennett6-24/+2
Not in source files See https://ariadne.space/2021/12/21/stop-defining-feature-test-macros-in-your-code/ Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-03-06examples.api: drop last JIM_EMBEDDED definitionsAntonio Borneo4-4/+0
The macro JIM_EMBEDDED was required to be defined before including jim.h in applications that embed jimtcl. This requirement has been dropped in 2010 with commit 2d8564100c86 ("Documentation updates") but it's use has remained for longer and it even re-appeared later in the examples.api. Drop last instances of JIM_EMBEDDED. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-06build: remove jsmn/*.o on cleanAntonio Borneo1-0/+1
json decoder is available since jimtcl 0.79, but the Makefile does not remove the related object files during 'make clean'. Add jsmn/*.o in the list of files to remove during 'make clean'. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-02tty: musl now requires _GNU_SOURCE for CRTSCTSSteve Bennett1-1/+3
Fixes #256 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-03-02auto.def: fix whitespaceSteve Bennett1-24/+24
Some tabs have crept into this file. Expand to spaces for consistency. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-03-02configure: don't complain about no ssl unless --ssl is givenSteve Bennett1-1/+1
SSL is now enabled by default, but it is only a fatal error if no libssl and --ssl is explicitly enabled. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-25jim: fix crash on infinite eval recursion0.82Steve Bennett1-2/+2
When this condition was caught, eval frame was incorrectly popped even though it was never pushed. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-25build: appveyor: support different libssl versionSteve Bennett1-1/+1
Use wildcards when packaging libssl in case the version changes. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-25docs: update shipped documentation for 0.82Steve Bennett1-53/+281
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-24dict with: return script resultSteve Bennett4-7/+33
Previously dict with returned the new dict value. Also fix an issue in the case where a dict element mirrors the name of the dictionary. Fixes: #241 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13docs: document ensemble and namespace ensemble createSteve Bennett1-0/+23
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13ensemble: Add a simple ensemble commandSteve Bennett7-2/+225
Uses a prefix to automatically map from subcommand to implementation. Includes support for namespace ensemble Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13docs: Add documentation for timerate commandSteve Bennett1-1/+25
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13configure: Default to --fullSteve Bennett5-50/+63
Now use --minimal and/or --without-ext to disable things. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13redis: Add -async supportSteve Bennett3-5/+131
Supports communication with redis as part of an event loop Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13clock millis, time: now use monotonic raw time if possibleSteve Bennett5-58/+60
Instead of using all time, these commands now use a monotonically increasing system timer so that they are not affected by time (e.g. ntp) adjustments. (But not on Windows since it doesn't work reliably) Fixes #240 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13build: fix warning on WindowsSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13windows: compatibility changesSteve Bennett2-2/+7
_fullpath isn't necessarily available, so check for it symlink() isn't useful enough on Windows to use Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13update ABI version to 101Steve Bennett1-1/+1
Version 0.82 modifies some public structs and functions, so bump the ABI so that binary extensions built against a previous version won't load. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13vwait -signal docs and test scriptSteve Bennett2-2/+31
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13vwait: add support for vwait -signalSteve Bennett4-9/+32
To break vwait if a handled signal is received. In this case, the handled signal(s) can be returned by signal check ?-clear? Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13improvements to tools/benchtable.tclSteve Bennett1-2/+43
Handles decimal times Better formatting. Still need to avoid duplication with bench.tcl Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13bench.tcl: Use the new timerate command if availableSteve Bennett1-53/+148
And make each test shorter but run for more iterations Better output for short durations Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13core: New timerate commandSteve Bennett1-0/+66
Based on TIP 527, but not 100% compatible Needs documentation Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13docs: update for new Tcl-compatible [info frame]Steve Bennett1-9/+21
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13Tcl-compatible 'info frame'Steve Bennett7-56/+236
Returns a dictionary with file, line, cmd, (possibly) proc and level. And support 'info frame 0' for the current command. Note that now all evaluation frames are captured, not just call frames. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13jim: make the Jim memory allocator replaceableSteve Bennett2-16/+25
Allows for a specialised allocator or debugging allocator. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13Jim_StrDupLen: minor optimisationSteve Bennett1-2/+2
No need to copy a char that will be overwritten in the next line. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-10bench.tcl: remove expr with multiple argumentsSteve Bennett1-1/+1
For compatibility when Jim is build without --compat Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-10Optimisation for Jim_GetWideExpr()Steve Bennett1-0/+4
If the expression is a simple integer, use it as-is rather than converting to an expression and evaluating. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-09build: fix check for isinf/isnanSteve Bennett1-2/+2
Needs to be #if not #ifdef for 'decl' checks. Otherwise build fails on systems without these. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-09build: handle old compilers without restrict keywordSteve Bennett2-0/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-06tests: exec2: may need to set default SIGPIPE dispositionSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-06tests: Don't run exec2 in a child interpreterSteve Bennett2-3/+4
Since signals aren't supported there and we need signals for some of these tests. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-06build: add github actions for CI on LinuxSteve Bennett1-0/+30
Signed-off-by: Steve Bennett <steveb@workware.net.au>