aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-10-15Fix dynamic loading of extensionsSteve Bennett1-4/+31
In order to accomodate both static and dynamic extensions, a unique init function is used for each extension. Take this into account when loading. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Small improvements to testsSteve Bennett6-24/+51
Make exec-9.7 test more reliable Quieten jim tests unless running manually Add jim pipe example Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix exec with vfork()Steve Bennett3-61/+68
Including the --disable-fork case And fix some compiler warnings Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to jim configureSteve Bennett15-357/+774
Create and use config.h Check for backtrace, fork, vfork, syslog, regcomp and others Disable extensions which require missing functions/features Check for one arg vs. two arg mkdir() Distinguish between mingw and native windows The aio extension has reduced functionality for ANSI C only Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make udp sockets usefulSteve Bennett7-21/+216
Separate socket types: udp client and udp server Allow client sockets to 'connect' to an address Allow server sockets to 'bind' to an address Add support for 'sendto' and 'recvfrom' Add socket client and server examples Document new udp sockets Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15More reliable approach to handling signal namesSteve Bennett1-107/+45
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Minor compiler compatibility fixes and ref count fixSteve Bennett2-7/+13
Don't mix declarations and code Don't try sizeof(long long) if we don't have it Object not freed on bad printf modifier in [format] Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15White space changes to match jimtcl master branchSteve Bennett1-850/+850
Makes it easier to diff Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Remove various obsolete filesSteve Bennett6-235/+0
Also rename and chmod some files Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Update test.tcl for new regsub/regexp error messageSteve Bennett1-8/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Check that a sourced script is completeSteve Bennett1-37/+24
* Use the real parser in Jim_ScriptIsComplete() * The parser remembers if a script is missing a close brace or quote * 'source' will reject a file which is not complete Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Implement 'info frame' and some related procsSteve Bennett5-50/+107
info frame allows access to source file/line for earler call frames Implement 'stacktrace' to give a live stacktrace And 'stackdump' to convert a stack trace to readable form Update 'errorInfo' to use 'stackdump' Also fix tailcall to retain source info And implement alias, lambda and curry with tailcall Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to tailcallSteve Bennett7-42/+104
Add tests and documentation Make tailcall work within 'try' Fix tailcall interaction with uplevel Use tailcall for dispatch in tree.tcl Also some related improvements in tree.tcl Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Move some core procs into the (Tcl) stdlib extensionSteve Bennett10-104/+350
Also implement 'local' to declare/delete local procs * Add tests/alias.test for testing alias, current, local * proc now returns the name of the proc created * Add helper 'function' to stdlib Reimplement glob and case to use local procs * This keeps these internal procs out of the global namespace Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reference count commandsSteve Bennett3-35/+46
So that commands are not deleted while executing Add a regression test for this case Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improve documentation, remove debuggingSteve Bennett3-54/+84
Completely document new regexp and regsub features Remove some old, commented-out debugging Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to 'file mkdir', 'file delete'Steve Bennett3-15/+134
file mkdir will now create intermediate directories file delete can now also delete empty directories Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to catch, return, signal, trySteve Bennett12-200/+601
Improve the ability to rethrow errors * Allow return to rethrow an error by accepting '-errorinfo stacktrace' * Also, 'catch ... opts' now also stores opts(-errorinfo) on error * Use these to provide better stack traces from 'case' and 'try' * Implement 'return -level' Make try/on/finally more Tcl 8.6 compatible * With support for 'on' handlers and docs Add support for catch options to try * Otherwise it's hard to use try to catch signals Improvements to signal handling * catch -signal now sets a list of the handled signals as the result * catch -signal won't execute the body at all if a handled signal is pending * up to 64 (jim_wide) signals can now be handled * if catch -signal is nested, the innermost catch will catch the error * new 'signal catch' allows ignored/blocked signals to be examined and cleared. * update docs on signal handling exec should indicate which signal killed the child Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix lassign to work properly with an empty listSteve Bennett2-2/+10
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix unexpected change in list orderSteve Bennett1-5/+7
Need to create string rep of list before converting in case it needs to be converted back, thus not losing order Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix 'format %%'Steve Bennett2-0/+11
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix some build problems and add lost featuresSteve Bennett17-79/+4265
Add some missing files needed for autoconf Make jim build standalone and without host jimsh Use (FILE *) for eventloop file handle Don't expect to support dynlib if no mmu Re-add nvp and win32 support (untested) Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix lsort for large integersSteve Bennett1-6/+18
The compare result may be a wide integer, so ensure that the sign is retaining when narrowing to an int Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add tests for 'file copy'Steve Bennett1-0/+62
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Need to add include path for generated jim.hSteve Bennett1-1/+1
2010-10-15Use configure to create jim.hSteve Bennett4-14/+14
jim.h can be used externally, including HAVE_LONG_LONG
2010-10-15Enhance catch and 'info returncodes'Steve Bennett4-35/+87
*: Add optional arg to catch, opts, like Tcl 8.5 to allow access to the code given by 'return -code' *: Use -- to signify end of options to catch *: 'info returncodes' can give the name of a single code *: Fix 'case' to handle 'return -code' properly
2010-10-15Add basic Tcl implementation of 'try ... finally'Steve Bennett3-15/+122
2010-10-15Improve error message from wrong args to procSteve Bennett1-2/+25
*: Use ?argname? to show an optional arg *: Use ?argument ...? to represent 'args', just like Tcl 8.5
2010-10-15Improve stack trace handlingSteve Bennett12-89/+219
*: Get rid of JIM_ERR_ADDSTACK and use interp->addStackTrace instead *: 'return -code error' doesn't add a stack frame *: Rename _file_copy to {file copy} for better error messages *: Use 'return -code' to prevent excessive levels in the stack trace Also rename info_nameofexecutable to {info nameofexecutable}
2010-10-15Add support for 'file copy'Steve Bennett3-0/+49
2010-10-15Add exec support for 2>@1Steve Bennett3-8/+28
See TIP #202: http://www.tcl.tk/cgi-bin/tct/tip/202.html
2010-10-15Code cleanups, mostly formattingSteve Bennett2-74/+64
2010-10-15Documentation, build system updatesSteve Bennett8-42/+727
Document reference-related commands *: ref, getref, setref, finalize, lambda were missing Build system updates *: Add check for long long to configure *: Change -Dwith_jim_ext_... to -Djim_ext_... *: Fix jim-eventloop when compiling with no long long
2010-10-15Simplify Jim_GetVariable(), upvar arg parsingSteve Bennett1-40/+42
2010-10-15Add Jim_SetResultFormatted() for simplied messagesSteve Bennett16-505/+432
Makes creating error messages much simpler Also convert a couple of long if/else to switch Also some error message improvements Also fix some memory leaks
2010-10-15Simplify and improve the for command optimisationSteve Bennett1-172/+130
*: No need to optimised one-off initialisation command *: Do first test before optimisation *: Just compare "incr" rather than looking up the command. Will only fail on redefined incr command!
2010-10-15Implement TIP #288Steve Bennett6-146/+308
See http://www.tcl.tk/cgi-bin/tct/tip/288.html Args and optional args may be to the left of required args
2010-10-15Allow catch to specify what is caughtSteve Bennett8-348/+502
*: Default to the same as Tcl. Not signal, eval, exit. *: Use 'catch -exit' to also catch exit. *: Also map for standard return codes: [info returncodes] *: Also Jim_ReturnCode() *: Add Jim_FindByName() for searching in a char* array *: Fix 'info nameofexectutable' if $::jim_argv0 is not set
2010-10-15Allow incr on unset variableSteve Bennett4-9/+35
From Tcl 8.5, implicitly set variable to 0
2010-10-15Simplify and speed up exprSteve Bennett5-687/+692
*: Reuse the ParseTokenList/ScriptToken machinery for 'expr' *: This is simpler than managing separate opcode/obj arrays *: expr opcodes are now in the same namespace as token types *: expr identifies int and double during parsing *: Move the 'while' common expr optimisations into Jim_EvalExpression *: Add a special trueObj and falseObj to help with these boolean optimisations *: Add lazy versions as the byte code is created instead of at the end *: Avoid repeated conversion attempts to int *: Once an object fails conversion to int and succeeds conversion to double, invalidate the string rep so the int conversion attempt no longer happens *: Also, avoid converting non-ints to int in expression optimisation *: No need for a string token for SEP and EOL tokens *: Fix shimmering of int -> double *: When an int shimmers to a double during an expression, remember that the value was originally an int (via a new type, coerced double)
2010-10-15Fix null pointer dereferenceSteve Bennett2-1/+11
If the condition expression of a for statement is invalid
2010-10-15Bug fixes and featuresSteve Bennett6-74/+110
Support end+<n> index And generally simplify the index handling Add support for 'info nameofexecutable'
2010-10-15Rework script/subst parser for improved performanceSteve Bennett4-196/+426
*: Keep abc(def) as a single token, but split abc($def) into 4 tokens *: Then optimise when interpolating to keep a reference to the underlying objects *: This speeds up the 'set a($b)' case a lot *: Also avoid so much alloc/realloc when parsing scripts and subst objects Also simplify cmdStruct creation *: Can omit args=-1 for expand *: Makes it easy to calculate the length *: Do it all in a single loop for simplicity, size and speed
2010-10-15Many improvements, bug fixesSteve Bennett25-702/+1692
*: Allow math functions to be enabled via configure *: Allow support for references to be removed *: Documentation updates *: Jim_ListLength() now returns the result directly *: Optimise list -> dict conversion *: Consistent capitalisation of some structures, functions *: Add support for abbreviations to Jim_GetEnum() *: The commands to 'info' may be abbreviated *: Use abbreviation support in parsing options to 'subst' *: Use Jim_GetEnum() to parse return code names *: Optimise 'array get', 'array set' if no conversion needed *: Import Tcl string.test *: string compare now returns -1,0,1 like Tcl *: Fix 'string last' with index=0 *: Add support for 'string reverse' *: Add -nocase option to 'string equal' *: Fix infinite loop in 'string repeat str -1' *: Support braced patterns in glob *: glob should not return dot files unless the pattern starts with . *: Simplify glob.tcl by using some new features *: When creating C extensions from Tcl, preserve newlines and invoke with Jim_Eval_Named() to produce more meaningful error messages. *: Also remove all comments, not just those starting in the first column *: Add support for 'n+n' and 'n-n' in string/list indexes (Tcl 8.5) *: Add a level to the stack trace for 'return -code error' *: 'return -code' should also affect the return from 'source' (see Tcl docs) *: Fix lsort -command *: Some systems don't have INFINITY
2010-10-15Various general fixes and cleanupsSteve Bennett11-299/+238
Add lsearch -command, update case to use lsearch Rename tcl6.tcl to tclcompat.tcl Remove // style comments Expand some tabs to spaces Fix some compiler warnings Remove some unused functions Don't close fd=-1 in exec
2010-10-15More expr tests and fixesSteve Bennett6-46/+736
*: 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 Bennett6-67/+657
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 Bennett3-12/+151
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.