Age | Commit message (Collapse) | Author | Files | Lines |
|
- Add wide() function to [expr] (same as int())
- Small error message changes
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Change the error message to match Tcl 8.6
"expected floating-point number" instead of "expected number"
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
It is possible for the alias prefix to shimmer, especially
if the prefix is a list with a single element
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This approach avoids a coverity warning
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
In this invalid script:
foreach a {0 1 2} {} {3 4 5} {
# ...
}
Courtesy of coverity
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Courtesy of coverity
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Courtesy of coverity
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Courtesy of coverity
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Jim_EvalFile() needs to explictly add an error stack frame.
Reported-by: Florian Schäfer <florian.schaefer+github@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Throw an error if a script or expression is missing a trailing bracket, brace
or quote rather than simply ignoring the error.
Reported-by: Florian Schäfer <florian.schaefer+github@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Preserve the source info for an interpolated script where possible.
e.g.
set script "puts $x"
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Commit 87ea45c91e removed the code to free cached callframes
when the interpreter is freed. Restore that code.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Sweep through and clean up all (most) of the comments in the code.
While there, adjust some variable and function names to be more consistent,
and make a few small code changes - again, mostly for consistency.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Only do fast dict->list conversion if there is no string rep
When converting list->dict, generate the string rep of a shared list to avoid
loss of info when converting to dict.
Also add a relevent test to dict.test
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
And clean up expr parsing slightly
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
And use it from the expr evaluator
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Less manual handling of reference counts means less chance of
error and less code.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
If both a val dup and a val destructor exist, need to
dup before destroying.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Probably only developers care about reference count mismatches
at exit.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Instead of an explicit call in jim.c, store load
handles as AssocData so that it is automatically cleaned up.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This reverts commit 5155f363872af642ade631396d1d7303285c3481.
It seems that this change has made dict element addition slower,
so revert it.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Resolve the tailcall command immediately in [tailcall] and stash it.
If a tailcall is currently being evaluated, new tailcalls in the same
frame are merged/deferred to evaluate in the same C stack frame.
Can't merge tailcall evaluations across uplevel.
Add some tests for these cases
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Tabs accidentally crept into source files in violaton of the style guide
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Currently if an error is caught with catch { }, the location
of the error overrides the location of the next error that occurs.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Use isinf() and isnan() when converting double to string
to ensure that the value is given canonical form.
And implement our own isinf and isnan if necessary
|
|
dict for, values, incr, append, lappend, update, replace and info
Also implement array stat (the same as dict info)
Note that [dict info] and [array stat] are for useful for checking
the behaviour of the hash randomiser
Add Jim_EvalEnsemble()
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Set dup and free operations to automatically manage reference counting
of dictionary keys and values.
Replace Jim_ReplaceHashEntry() with JimDictReplaceHashEntry()
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
To avoid hash table collision attacks (n.runs-SA-2011.004)
Note that this options is *off* by default, but it is reasonable
to consider reversing this.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Currently tailcall resolves the command in the parent
namespace.
This also fixes the deletion of [local] commands
such that they are always correctly deleted.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
aio [open], as well as similar commands return the name of the
created command. If this is done in the non-global namespace, the
returned name is implicitly scoped to the current namespace while
the actual command is created in the global namespace. Thus [close]
does not work when invoked in that namespace.
The solution is to return a fully qualified name, such as ::aio.handle3
Note that this may also be a problem for similar command such as
[proc] and [alias] that return command names.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Andy <jimdevel@hummypkg.org.uk>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
From the interactive prompt.
Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Andy <jimdevel@hummypkg.org.uk>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Reported-by: Paul Fertser <fercerpav@gmail.com>
|
|
|
|
And remove declarations of some obsolete functions
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|