cwal

All files named "include/wh/cwal/whcl/whcl.h"
Login

All files named "include/wh/cwal/whcl/whcl.h"

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History for include/wh/cwal/whcl/whcl.h

2022-04-11
02:52
Centralized setup of the whcl-centric cwal_json_output_opt settings. (Edit re-applying trunk tag here. The repo somehow got into a state with two branches at the same time and cancelling the trunk tag completely eliminated the trunk.) file: [9f73838e30] check-in: [b50f3fa675] user: stephan branch: trunk, size: 155440
2022-04-10
04:44
Expanded whcl numeric tests and fixed the not-working-as-advertized script-bound number-parsing routines. file: [43f862f214] check-in: [07e5f6c85c] user: stephan branch: trunk, size: 154909
00:22
Removed some dead code. file: [5d4b5c2435] check-in: [e76d4dbd84] user: stephan branch: trunk, size: 153708
2022-04-09
05:44
"Finished" the whcl port _back_ to "deeply-scoped." This seems to solve the explosion of cyclic values caused by aliases but potentially requires more allocs on the whole. Oh, this means that the sweep guard propbably now needs to be moved back into the scope. Hmm. This approach is much faster, in any case, because sweepup/vacuuming are more localized. file: [417e78f231] check-in: [d2b51b4325] user: stephan branch: whcl-scope-rework, size: 153709
03:32
Switched most of whcl back to a "deeply scoped" model, in order to help alleviate the cyclic zombies caused largely by the new proprefs features. Still need to move the evalHolder, dotHolder, and the like from the engine back into the scope. file: [85d28185f6] check-in: [dceee567d5] user: stephan branch: whcl-scope-rework, size: 153752
2022-04-05
03:17
The beginnings of a 'with' command for whcl, per suggestion by Larry B. It's not yet complete and has a few bugs. It's a process. file: [865c909c01] check-in: [1d8ebbf447] user: stephan branch: whcl-with, size: 152970
2022-04-02
15:13
Docs and internal cleanups. file: [70dcdc0212] check-in: [e61ebfc44e] user: stephan branch: trunk, size: 152772
11:12
whcl.load-module now treats a CWAL_RC_RETURN result intuitively/conventionally. Added a sample loadable module implemented entirely as script code, to replace require.whcl (since that one is now built in). file: [d621ea1bbc] check-in: [86651140ed] user: stephan branch: trunk, size: 152411
2022-04-01
18:57
Corrected whcl eval so that the -> flag works with a {} operand. Added line/column renumbering support to whcl_script. Reworked whcl__script_slice() to be able to handle both client-alloced and alloced-by-it destination whcl_script instances. Added __COLUMN builtin value. file: [c1b1f12814] check-in: [d15d10652f] user: stephan branch: trunk, size: 152275
13:10
Numerous cleanups in whcl's install-api bits. Made whcl.Script an installable API rather than a core class. Added -post flag to whcl new command to make the special handling of a trailing {...} argument opt-in and simplify Script constructor usage. file: [4b3f1e7875] check-in: [6c7675f79a] user: stephan branch: trunk, size: 149948
2022-03-31
21:15
Added a mechanism to cwal_json_output() to add a proxy function for converting to-JSON'd values to something JSON can handle use. Used this to implement semi-generic whcl support for a to-jsonable method and used that to make whcl.Script JSON-able. file: [5dd3d54477] check-in: [5adaa164b2] user: stephan branch: trunk, size: 153618
16:53
More work on the whcl_script binding. Added -f (filename) flag to script ctor, so it can load from files. file: [2bcaed8739] check-in: [46de7557a0] user: stephan branch: trunk, size: 152623
06:00
Internal tinkering with whcl. Added whcl_get() and friends. file: [ce46a9e1a9] check-in: [291f9b2af0] user: stephan branch: trunk, size: 151198
03:38
More work in/around the whcl_script binding. Added -noscope flag to the catch command. file: [2a5cc88926] check-in: [9838b0ecdd] user: stephan branch: trunk, size: 150392
2022-03-30
23:51
More work on the whcl tmpl and Script APIs. file: [4b8666f5bd] check-in: [8f4004d40d] user: stephan branch: trunk, size: 150054
20:10
Started documenting whcl script binding of whcl_script. Added a script name accessor/mutator method. file: [3bda186889] check-in: [52be9958f1] user: stephan branch: trunk, size: 150097
19:51
Merged inadvertent fork. file: [781448651c] check-in: [aecf588b8d] user: stephan branch: trunk, size: 150095
19:19
Started binding whcl_script to script space, and taught the eval command to special-case them, as a faster alternative to recompiling the same strings for evaling. It's undocumented and incomplete, but the basic functionality works. file: [b931c8aef6] check-in: [8e69c7dff8] user: stephan branch: trunk, size: 149310
17:20
Initial port of s2.tmpl to whcl. Docs are TODO. This change really points out the need to expose whcl_script to the script API, so things like tmpl-generated scripts need to be compiled only a single time. file: [20afbe1d7e] check-in: [c0c5658f44] user: stephan branch: trunk, size: 149305
2022-03-28
14:08
whcl: rename the proc -xlookup flag and its related native flags to -xsym. Added some docs for it. file: [aceb8a3bfc] check-in: [bff4bb6c65] user: stephan branch: trunk, size: 142180
13:12
Added some metrics to whcl. Moved whclsh's metrics-dumping code into whcl_dump_metric(). file: [e8d98d2709] check-in: [19f3df632b] user: stephan branch: trunk, size: 141881
2022-03-24
11:54
Moved whcl__scope_block_size from internal.h to whcl.h to fix a compilation error in whclsh in amalgamation-mode builds. file: [f0baea60f4] check-in: [9fdc6087dd] user: stephan branch: trunk, size: 141395
2022-03-22
10:22
Refactored whcl scope list so that it's not subject to realloc invalidation, simplifying some higher-level usage and validation of push/pop levels. file: [008737ff0d] check-in: [fa642d8241] user: stephan branch: trunk, size: 140917
00:05
Merged in the [whcl-single-scope] branch. This is a significant overhaul of how scoping works in whcl. file: [050814b178] check-in: [c205852940] user: stephan branch: trunk, size: 141514
2022-03-21
23:50
More docs and internal cleanups in prep for moving this branch to trunk. file: [676daa3685] check-in: [be102e8742] user: stephan branch: whcl-single-scope, size: 139509
23:22
More whcl_scope API renaming and reorganizing. file: [dffd5376c2] check-in: [b969dfc4d0] user: stephan branch: whcl-single-scope, size: 138294
21:53
Because all/most values are now global-scoped, moved the so-called dot-op holder from whcl_scope to whcl_engine, which saves tons of allocs in the current amalgamated unit tests (anywhere from 170 to 5160, depending on the recycling-related flags). file: [d539529906] check-in: [4b45e4145d] user: stephan branch: whcl-single-scope, size: 135137
21:06
Renamed whcl__scope to whcl_scope in prep for making it a first-class member of the public API. file: [8546fbdbc8] check-in: [e79422d17c] user: stephan branch: whcl-single-scope, size: 135214
20:14
Corrected some slightly confusing sweep metric output. Testing, so far, shows that recursive vacuum works in this branch, possibly because all relevant values are stored in a single scope, leaving no real room for related breakage. file: [290ce62e81] check-in: [2586dfab1b] user: stephan branch: whcl-single-scope, size: 134321
16:31
Minor doc tweaks. file: [7fa2b754d6] check-in: [dba9c1f763] user: stephan branch: whcl-single-scope, size: 134122
12:03
Cherrypicked [2b4811a743] and cleaned up/corrected the sweep/vacuum interval calculation. file: [8de1c40f38] check-in: [87b843f630] user: stephan branch: trunk, size: 129404
01:07
Moved the sweep guard and counter from whcl__scope to whcl_engine. Testing shows it vacuuming quite a lot but why it has to vacuum so much is unclear - refcounting should be taking care of most of them. Hmm. file: [6c121fd9a2] check-in: [2b4811a743] user: stephan branch: whcl-single-scope, size: 133914
2022-03-20
22:05
Moved whcl eval holder from whcl__scope to whcl_engine, saving a lot of allocs but now officially moving all whcl-managed values into the global scope. file: [84453c35f0] check-in: [d8f9cef600] user: stephan branch: whcl-single-scope, size: 132601
21:16
More work on the new scope model, but the number of abstraction leakages is starting to pile up to an uncomfortable level. file: [e7ecd5bdd1] check-in: [fd2e5aed1d] user: stephan branch: whcl-single-scope, size: 132580
17:18
More work on the single-scope experiment. Just discovered that we can no longer set call-local vars for funcs which are triggered via a native function (e.g. a regex replace callback) unless we add a way to tell the upcoming callback that its whcl__scope is already in place and should be reused, but that seems a bit hacky. Time for a break. file: [ca5f588790] check-in: [ae7eb8a01f] user: stephan branch: whcl-single-scope, size: 131814
16:39
Fixed missing releasing of the eval holder array in whcl__scope_pop(). file: [6eb2b47950] check-in: [0627ff9017] user: stephan branch: whcl-single-scope, size: 130128
16:25
A complete overhaul to get whcl running in (mostly) a single cwal_scope, using whcl__scope for variables. This has horrid performance implications (sweeping and vacuuming take ages) but hypotheticaly eliminates (almost) any possibilities of leaks which we cannot currently reach because of the fragility of recursive vacuum (the exception being those triggered by a forever-running function). It seems to essentially work but not quite properly - loops are not recycling memory like expected. There is much analysis, tweaking, and decision-making to do. file: [89b3daacc8] check-in: [7fd98f2fa0] user: stephan branch: whcl-single-scope, size: 129436
2022-03-16
14:11
whcl: more bending of code to enable configurable function-call symbol lookup boundaries. Whether this a feature or bug is not yet clear. It enables certain types of callbacks which aren't otherwise possible but it's also a bit invasive. Still might remove it. file: [65dc38da57] check-in: [2ac3f991d6] user: stephan branch: trunk, size: 128844
11:43
whcl: experimenting with an approach to telling the engine that some functions should not act as boundaries for symbol resolution lookup. It works fine with script functions but levels of indirection internally make it problematic with native functions. Still subject to much change or removal, but some significant unrelated fixes and tweaks are also in this batch, so it's not in a branch of its own. file: [c7deb06692] check-in: [4896aa02b3] user: stephan branch: trunk, size: 127518
2022-03-14
09:55
whcl symbol-lookup overhaul: symbol lookup is now _more or less_ conventional instead of historical cwal/s2 style. This breaks certain loadable module APIs and fixing those is next on the TODO list. file: [c0a478619e] check-in: [df93d45e85] user: stephan branch: whcl-symbol-lookup-overhaul, size: 126919
2022-03-13
10:13
Enhanced cwal_glob_matches_cstr() to support case-insensitive glob matching. Changed whcl string glob-matches/matches-glob to support that but left that out of s2's glob-matching because how it specifies that flag makes it awkward to change without breaking existing out-of-tree scripts. file: [b4c45a6441] check-in: [166f2fcb2d] user: stephan branch: trunk, size: 123625
08:26
Split whcl's string.glob into glob-matches and matches-glob to hopefully avoid more downstream confusion about argument order, and replaced the final argument with a -like/-ilike/-glob flag to specify the globbing style. file: [c2f0eace00] check-in: [8f3f11bd74] user: stephan branch: trunk, size: 123447
2022-03-11
09:20
New whcl compile/eval options which take over the memory of a client-provided buffer, rather than copying it. API renaming. Added init-script and history-file env var support to whclsh. file: [2675a0b5c7] check-in: [f7406030b4] user: stephan branch: trunk, size: 123008
2022-03-06
16:43
More whcl docs and work on the sqlite3 module unit tests. file: [abbf0dfc42] check-in: [89e0807cb1] user: stephan branch: trunk, size: 120703
08:21
More work on refactoring the tok2 API into a public whcl_script interface. Tons of API renaming. Got the first whcl sqlite3 module tests running. file: [78e941ace5] check-in: [03673eed9c] user: stephan branch: trunk, size: 120426
05:07
Renamed the tok2 API to whcl_script in prep for upcoming restructuring. Fixed a memory corruption bug uncovered by valgrind in which a whcl__scope pointer was moved out from under us via a realloc when the whcl set command's RHS was a sub-command and pushed the scope list beyond its current limit. file: [30a2db36f1] check-in: [b9b3f93451] user: stephan branch: trunk, size: 117055
03:58
Accommodated a recent API change. Added a whcl function needed by the pending sqlite3 binding. file: [920343d6dd] check-in: [bda484f89b] user: stephan branch: trunk, size: 118952
2022-03-05
06:05
whcl: added -this flag to the object command, which behaves like the -scope flag but also makes 'this' refer to the scope properties object. file: [176a3f60ac] check-in: [ed907a6d3d] user: stephan branch: trunk, size: 118582
2022-03-04
01:11
whcl: added __debug {...} blocks which work like eval -scope {} but discard any eval result and are only executed if the engine's debug-block feature flag is enabled. Restructured how assert/affirm tracing works to make use of the new whcl_feature_flag_set() API. file: [f4c73ae2a8] check-in: [5a8afa3a35] user: stephan branch: trunk, size: 118496
2022-03-03
07:24
whclsh: show the list of available install-api modules at startup and resolve a mis-propagating was-interrupted result code which could be triggered by tapping ctrl-c while readline is waiting on input. file: [04268e5cae] check-in: [95893e5789] user: stephan branch: trunk, size: 117263
06:25
whcl's 'this' is once again a call-local variable to avoid certain unfortunate fiddliness in downstream code like the regex and sqlite3 modules. It retains its status as a built-in so that we can keep vars from being declared with that name, but it's now internally managed like a normal var. file: [bce564392f] check-in: [9f7dca8dcb] user: stephan branch: trunk, size: 116535
05:55
More work on the whcl regex module. Need to step back and evaluate replacing the 'this' built-in value with call-local variables, as modules like this one often want to supply their own 'this' in eval blocks. file: [8942e5a7fd] check-in: [3cc5d4d6e1] user: stephan branch: trunk, size: 117594
04:23
Added a tuple class to whcl but it's not yet documented. file: [13e4140b56] check-in: [603062e3ce] user: stephan branch: trunk, size: 116081
04:03
Got the regex-posix module ported from s2 to whcl but still have many docs and tests to port, and have to interrupt this port to add tuple-type APIs to whcl because this module exposes them to scripts. file: [35d7d319df] check-in: [a49bc893cf] user: stephan branch: trunk, size: 115952
01:02
Ported C99 math module from s2 into whcl. file: [6cd671b72c] check-in: [011f5b2df5] user: stephan branch: trunk, size: 115092
00:26
Ported s2 infrastructure needed for sample_cpp into whcl. Introduced an s2-style alternative class structure to get that working. Module build fixes. file: [ba78e324c8] check-in: [66b90b63f6] user: stephan branch: trunk, size: 114902
2022-03-02
17:36
More work on the whcl module-loading infrastructure. Plugged statically-bound external modules in via whcl.install-api. file: [1c36902ab6] check-in: [96525eefe2] user: stephan branch: trunk, size: 105455
11:41
Doc additions. file: [887ffa0a5c] check-in: [aa39dea9dd] user: stephan branch: trunk, size: 103590
10:54
Ported s2 loadable module API and sample module to whcl. file: [c09f36bb7e] check-in: [e1bf6b8270] user: stephan branch: trunk, size: 103570
06:56
whcl: changed logical && and || operators to use JS semantics rather than C, as that's generally more useful in scripts. Changed whcl math ops to use floating point if either operand is floating point, instead of s2's semantics of always using the LHS type. More docs. file: [fba1f05e3d] check-in: [29123f3cda] user: stephan branch: trunk, size: 89828
02:08
Ported s2's time API to whcl. More whcl docs. file: [dc352e627f] check-in: [52405f41cf] user: stephan branch: trunk, size: 89830
2022-03-01
02:48
whcl doc touchups. Fixed another counter in whcl_dump_tokens() and added a flag to that function to cause virtual EOF tokens to be included in the output (they are no longer on by default). Added -eof flag to pragma dump-tokens to apply that flag. file: [c44b524768] check-in: [5c8fbd73eb] user: stephan branch: whcl-dot-op, size: 89293
2022-02-28
14:18
Doc touchups. file: [d4d2eff78c] check-in: [92ed8a7d3a] user: stephan branch: trunk, size: 88979
02:13
whcl: no longer load supplemental APIs by default, instead delegating loading to script code via the new (whcl install-api THE-NAME...) function. This significantly lowers memory usage for most scripts. file: [f9aaddf973] check-in: [1ac4d9d037] user: stephan branch: trunk, size: 88498
2022-02-27
04:07
Cleanups in the whcl PathFinder init and adjacent code, added the path-from-env method and more docs. file: [a6e1bbce4a] check-in: [ca33c44e06] user: stephan branch: trunk, size: 88501
02:18
Minor internal cleanups and added some missing API docs. file: [0d20cc5593] check-in: [15c495f9a8] user: stephan branch: trunk, size: 86967
2022-02-26
20:57
Minor header touchups. Re-enabled the historical 'touch' feature of mkcdep.c to work around some otherwise weak deps handling when headers change. On the one hand, this improves rebuilding for header changes. On the other, it causes the deps files to get rebuilt twice in a row at times. file: [d75c759a23] check-in: [347aa1caf8] user: stephan branch: trunk, size: 84085
16:45
Tweaks to the various config headers. Moved whcl dist creation into an external script. file: [7d696d37dc] check-in: [a2df56da01] user: stephan branch: trunk, size: 84453
14:33
whcl: fixed a broken assert in the decl command. The set command now supports -const when used for setting object properties. Added whcl[fs] pushd/popd functions (implemented as script code). file: [04180aaa70] check-in: [34e4e2df9d] user: stephan branch: trunk, size: 84911
2022-02-25
21:28
Ported in the s2sh shell API to whclsh. Moves the string globbing API from s2 into cwal core and added String.glob method to whcl (with different semantics than s2's). Added missing whcl api-os.md. More whclsh docs. file: [6ef49a8595] check-in: [86a52436f3] user: stephan branch: trunk, size: 84048
11:53
whcl: added the Exception class, primarily so that the exception prototype can be extended by scripts. The exception builtin command is still easier to use. file: [d14a81a063] check-in: [b54d23484a] user: stephan branch: trunk, size: 82186
2022-02-24
14:47
whcl: painstakingly added some special support for -flags in script-side functions. This required much experimentation and dead-end/deleted code due to levels of call indirection interfering with making the distinction between real flags vs flag-like strings. file: [c1681e4c80] check-in: [50919c3bb8] user: stephan branch: trunk, size: 81870
2022-02-23
12:36
whcl: added whcl[json] APIs. Added mechanism for extending whclsh with client-side C code without modifying whclsh.c. Some minor API renaming. Fixed a cwal_value midhandling bug in whcl__call_cwal_f() which triggered an assert(). file: [d73ade807b] check-in: [823625ce00] user: stephan branch: trunk, size: 81677
10:43
Renamed whcl/whcl.h → include/wh/cwal/whcl/whcl.h. Moved s2 headers to include/wh/cwal/s2/. and whcl's to include/wh/cwal/whcl/. file: [3b98f49941] check-in: [3772b84475] user: stephan branch: trunk, size: 79977