aboutsummaryrefslogtreecommitdiff
path: root/jim.c
AgeCommit message (Collapse)AuthorFilesLines
2010-10-15More expr tests and fixesSteve Bennett1-26/+127
*: Add tests/expr-new.test from Tcl *: Directly convert from int to double if possible *: Always treat '-' in front of a number as unary minus so that '-0x1234' works. *: Fix expr when the variable does not exist *: Add optional support for math functions *: Also double/0 == Inf or -Inf
2010-10-15New features, docsSteve Bennett1-12/+189
Implement lsearch in C with options *: lsearch -exact, -glob, -regexp, -not, -bool, -all, -inline Add tests for lsearch and expand expr operators: in and ni (Tcl 8.6)
2010-10-15New featuresSteve Bennett1-11/+57
Add unset -nocomplain and tests Implement lrepeat
2010-10-15More expr cleanupSteve Bennett1-254/+80
Also remove all literal sharing code. It was disabled anyway.
2010-10-15Simplify expr evaluationSteve Bennett1-322/+277
2010-10-15Revert "Simplify handling of {expand}"Steve Bennett1-38/+41
This reverts commit 3201b17708d278541b66962045b68f9b0687c1dc.
2010-10-15Simplify handling of {expand}Steve Bennett1-41/+38
*: Detect it during tokenisation rather than afterwards *: Create a special token for it *: Also create most tokens as JIM_TT_STR rather than JIM_TT_ESC
2010-10-15Fix many problem with expr evaluationSteve Bennett1-501/+875
*: Import Tcl expr tests (expr-old.test) and fix things: *: !double should be boolean (int) *: double&&double and double||double should be boolean (int) *: 2.34e+1 and 2.0e2 are an acceptable double values *: precedence of && and || is not equal *: precedence of ? and : is not equal *: expression "2:3" is invalid *: lazy evaluation involving multiple && and || was quite wrong *: Fix unary minus wrt subexpressions. e.g. -(-1.5) *: Also add support for functions: int, double, abs, round *: Fix lazy evaluation of ternary operator *: Error on missing ?, missing : *: Fix double unary minus *: Add unary plus *: Fix parsing of double with no '.' before 'e'. Also support 'E'. *: Right-to-left associativity of ternary operator is *almost* correct *: Import div/mod of -ve integers from Tcl *: Rotate (<<< and >>>) failed because of wrong arity *: Don't use auto-converted double values *: When an expression fails, show the expression *: Bump version to 0.62
2010-10-15Bugs, features, testsSteve Bennett1-11/+23
Subst was broken for backslash escapes Add support for return, break, continue in subst commands Accept abbreviations for switches to subst Fix 'list #' More tests
2010-10-15Source cleanups, typos, add testSteve Bennett1-88/+131
2010-10-15Improvements to 'scan'Steve Bennett1-224/+116
Use libc strtoull() for long long conversions Also some white space cleanup Also remove some win32 vestiges Also improve error messages for array access errors
2010-10-15Speed up assign to static dict sugarSteve Bennett1-74/+65
2010-10-15Bug fixes, documentation updatesSteve Bennett1-8/+15
jimsh - retry on EINTR from fgets() Fix 0 -> NULL for 64 bit systems Fix overlapping memcpy Fix jim array dereferencing bug *: Counting of parentheses was incorrect with nested array references *: The result for array dereference wasn't being used properly Add os.uptime command Documentation: autogenerated command index Fix gets when last line has no newline
2010-10-15Fix time, bump versionSteve Bennett1-3/+8
time should return wall time, not cpu time (Tcl compatible) Bump version to 0.61 ------------------------------------------------------------------------
2010-10-15Enhance env, fix error messagesSteve Bennett1-8/+11
env command allows a default to be supplied Fix wrong 'file rename' error message
2010-10-15Build improvements, bug fixes and compiler warningsSteve Bennett1-33/+26
Remove unimplemented 'after restart|expire' from eventloop Allow libjim to be build as a shared library On some platforms, regex.h needs stdlib.h first Use ualarm() only for times < 1 second Fix warnings found by clang static analyser *: printf/syslog %m isn't portable *: some variables set but never read *: some possible null pointer references (although mostly impossible) *: also minor fixes to jim unit tests Fix 'syslog -options <n>' Must null terminate readlink() result
2010-10-15jimsh improvements plus documentationSteve Bennett1-3/+1
Add /lib/jim to the default auto_path *: Otherwise there is no 'standard' location to install packages Prompt should show name for all non-zero return types Initial documentation for Jim ------------------------------------------------------------------------
2010-10-15Fix a couple of bugsSteve Bennett1-6/+12
format %.0f was wrong Minor bug in [string trimright] *: When the string was empty, a read was done of str[-1] ------------------------------------------------------------------------
2010-10-15Implement 'array' in CSteve Bennett1-6/+42
2010-10-15Improve expression supportSteve Bennett1-43/+104
Especially ternary operator and unary minus Still evaluates both sides of the ternary operator :-( Fix unary minus And add const in more places to avoid this mistake in future
2010-10-15Bugs, features and testsSteve Bennett1-14/+26
source fails with zero length file unknown can't be called recursively *: This can be useful when using unknown to dynamically load code, which may in turn want to dynamically load code *: Limit it to 50 recursions though Allow string greater/less comparison *: Comparing two strings for order did not work Implement file join *: It's not to hard and is handy when working with the current dir, "" Don't omit [unknown] completely from stack trace *: Since we lose valuable informtion, just omit the name Fix return from case Turn regexp patterns into real objects *: Thus caching the compiled regexps Allow error to rethrow an error Replace bcopy() with more standard memcpy() Fixes to parray, improve errorInfo *: errorInfo takes an optional stack trace Add tests for rethrowing errors via errorInfo Fix ndelay *: Was looking at wrong param *: Also fix usage/help for aio.socket Package should be able to call exit *: Currently any return from a package is changed to JIM_ERR Line counting is incorrect for backlash newline
2010-10-15Bugs, features, testsSteve Bennett1-0/+1
The result of boolean ops on doubles is an int *: e.g. 0.5 < 0.1 should be 0, not 0.1 Implement jimsh -e <cmd> Allow jim to be built in a different location *: e.g. mkdir build; cd build; ../configure ...; make jimsh Add dict.test
2010-10-15Bugs and testsSteve Bennett1-1/+1
jimsh argv0 was wrong *: Should be the name of the script when run non-interactively Missed adding jim.h changes for errorProc Add lsort -command tests to jim/tests Handle the case of a script with no tokens ------------------------------------------------------------------------
2010-10-15Improve error handlingSteve Bennett1-39/+127
*: Improve stack trace handling on errors *: Add 'info source' *: Add 'info stacktrace' *: Add errorInfo procedure to generate a human readable stack trace *: Add tests for stacktrace ------------------------------------------------------------------------
2010-10-15Fix a couple of bugsSteve Bennett1-0/+1
Fix unset ::var properly this time Ensure that jimsh exits with the correct exit code *: Previously a script that did 'exit 0' would exit with 7!
2010-10-15Enhance exec, bioSteve Bennett1-1/+1
Support @filehandle syntax Support for nommu Disable os.fork for nommu Remove trailing newline No need for binary escaping in bio module ------------------------------------------------------------------------
2010-10-15Implement some new featuresSteve Bennett1-35/+165
Implement 'lreplace' Implement 'string last' Implement 'pid' Implement 'info procs' Implement 'info script' Implement 'info patchlevel' as an alias for 'info version' Implement syslog extensions for jim Fix return code display in jim-interactive.c Make jim more compatible if JIM_TCL_COMPAT is set *: Use tcl_interactive rather than jim_interactive *: Use auto_path rather than jim_libpath Add "." to the lib search path, not "./" Fix a couple of files with CRLF line endings
2010-10-15Fix a couple of small bugsSteve Bennett1-4/+6
*: Need to null terminate the buffer in Jim_EvalFile() *: If an object is used a subst and a script, a crash will result. set x abc subst $x eval $x ------------------------------------------------------------------------
2010-10-15freebsd: make it compileWojciech A. Koszek1-0/+13
Casts to (void) are in order to silent GCC about unused variables. I didn't want to break ABI for the sake of clean compilation Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-15errors: improve stack traces for return -code errorSteve Bennett1-12/+3
the file and line number for return -code error's are now added to the dumped stack trace. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-10-15Remove intptr_tSteve Bennett1-5/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix eCos compatiblity problems with autotools.oyvind1-15/+19
2010-10-15Comparison of doubles is a boolean.oharboe1-7/+15
Not a double. expr {0.5 < 1.0} Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Line numbers wrong with {expamd}oharboe1-5/+9
If an error occurs when {expand} is in operation, the line number is wrong. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix crash in substoharboe1-2/+6
If an object is used in subst, then source, a crash will result Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make [format %c 0] work (embedded nulls)oharboe1-7/+7
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Should be able to compare strings for order in exproharboe1-6/+14
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix 'unset ::var' to unset a global varoharboe1-4/+7
It was doing nothing. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Build fixes, better Jim_EvalFile()Steve Bennett1-26/+14
*: make-c-ext is now make-c-ext.tcl *: build doc/Tcl.html with asciidoc *: Jim_SetIntResult -> Jim_SetResultInt *: Jim_EvalFile() now reads the file contents in one go
2010-10-15Fix some runtime errorsSteve Bennett1-5/+14
Need to duplicate a possibly shared object when loading a package fails Need to initialise signal-related fields in the jim interp Return an error from 'lsort -command' on failure
2010-10-15Convert jim-aio.c to use subcmdSteve Bennett1-2/+2
Also: - make stream.server set SO_REUSEADDR - do object reference properly for callbacks - white space cleanup in jim-eventloop.c - fix the pwd command - add support for JIM_MODFLAG_FULLARGV to subcmd - make verbose runtests easier to read - bio might not be available
2010-10-15Small improvementsSteve Bennett1-1/+3
Save (but then cleanup) generated extensions Add package and readdir to 'all' extensions Order of static extensions matters!! Simple C define support for configured extensions Fix some compiler warnings
2010-10-15Lots of improvementsSteve Bennett1-361/+288
jim --- Add a unique id facility to jim (Jim_GetId()) Remove unused jim_vasprintf(), Jim_AppendString_sprintf() Remove duplicate output in Jim_Panic() Add support for catch -signal aio --- Use this for aio handles aio automatically creates stdin, stdout and stderr channels Jim_AioFilehandle() returns the 'FILE *' filehandle for a channel If JIM_TCL_COMPAT is set, create top level open, close, read, puts, etc. load ---- load core command split out into jim-load.c package ------- package core command split out into jim-package.c added 'package list' posix ----- Remove os.sleep, os.usleep, os.sethostname, os.signal, pit, Jpit Most of these are in 'signal'
2010-10-15Add more tcl6 compatibilitiesSteve Bennett1-26/+158
- string trim, trimleft, trimright - lsort -command, -integer - fix 'unset ::var'
2010-10-15Split package and load out of jim.cSteve Bennett1-461/+1
2010-10-15Strip out unneeded junk from JimSteve Bennett1-785/+56
Nvp, getopt, move interactive processing to jim-interactive.c
2010-10-15Cutover to new workware fork of Jim TclSteve Bennett1-801/+755
Note that this commit removes some files and undoes some commits which will be reapplied later. This is the easiest way to switch across. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-04lists: fix crash in ListInsertElements0.51Øyvind Harboe1-0/+1
It wasn't added to the API list => NPE JIM_REGISTER_API(ListInsertElements); Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-02-01Bring corrected license as mentioned in freebsd/...Wojciech A. Koszek1-2/+1
Remove "FreeBSD license" statements, since it's not a correct term I believe. Small cleanup while being here.
2010-02-01Revert "Bring correct license -- I think freebsd/ directory has an agreements"Wojciech A. Koszek1-1/+2
This reverts commit 1e2fdd7d9e877fbe2c88a4c32f098ce1e575dc1d.