Age | Commit message (Collapse) | Author | Files | Lines |
|
And allow current source file to be set
Fixes: #268
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Now 'constraint cmd|package' is like 'needs' but sets a constraint
The command to 'needs cmd' and 'constraint cmd' can now take
a subcommand to check.
Add 'constraint|needs eval|expr' to make some constraint checks
simpler.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
loop i 5 {
loop j 6 {
# This breaks out of both loops
break 2
}
}
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Avoid unexpected issues by concatenating multiple arguments.
This does create an incompatibility with early versions, but
it is generally trivial to convert existing code to one of two forms:
1. expr {$a + $b} -- usually correct
2. expr "$a + $b" -- usually incorrect
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This means that instead of just [list index 2+1], we can now do
[list index end-$n*2+1]
This applies to:
lindex, linsert, lreplace, lset, lrange, lsort, regexp, regsub
string index,first,last,range
Also add tests for both direct integer expressions and indexes.
Still needs doc update.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
For convenience, many commands now accept integer expressions
rather than only simple integers.
These are:
loop, range, incr, string repeat, lrepeat, pack, unpack, rand
This simplifies many cases where previously expr {} or $() was required.
e.g.
foreach i [range 4+1 2*$b] { ... }
string repeat 2**$n a
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
It is especially convenient to add -1 for something like:
lindex $list end-$BACK-1
or:
string range $str $p $p+$len-1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
If the pattern begins with -, the internal invocation of regexp
will treat the pattern as an option. Fix this by adding -- to the
internal invocation of regexp.
Fixes #154
Reported-by: Barry Arthur <barry.arthur@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
readdir, tty, utf8, signal, alarm, kill, file, jimsh, posix, aio,
history, interp, pack, unpack, eventloop, exec, load, package,
regexp, regsub
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Should produce an error, but did not previously
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
|
|
- Add wide() function to [expr] (same as int())
- Small error message changes
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>
|
|
Now an octal literal needs to be explicitly indicated with a leading
0o or 0O, otherwise the number is treated as decimal.
This patch also adds support for binary literals.
e.g. 0b101 0B1101
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
And import some up-to-date tests from Tcl 8.6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
|
|
This was completely wrong. The arg order was wrong such that
when test constraints were specifed the test was always skipped!
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Much closer to tcltest now, including constraints.
Try to get all appropriate tests running under both Jim and Tcl.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Use number of paren expressions with regexp -inline
Fix a problem with regexp -start and an anchored search
Fix regexp -inline -indices
Fix regexp matching with an empty pattern (e.g. ^)
Fix some cases where regsub -all did not return all results
Fix some regsub cases with an empty pattern
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>
|
|
These can vary on different systems
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
And other small testing improvements
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|