cwal

All files named "s2/test.c"
Login

All files named "s2/test.c"

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

History for s2/test.c

2022-04-03
15:15
Renamed PROP_REF back to PROPREF and WEAK_REF to WEAKREF. Fixed a crash bug in cwal_json_output() caused by the past few days' changes. file: [94125a66d0] check-in: [97c2a53ad6] user: stephan branch: propref-type, size: 31345
2022-01-21
10:04
Re-added s2 C++ support. Got s2 test binaries building. file: [b5a3bca78a] check-in: [0bccd940fd] user: stephan branch: build-reorg, size: 31302
2021-08-01
10:23
Removed CWAL_FEATURE_SCOPE_STORAGE_HASH and changed the default of CWAL_OBASE_ISA_HASH to 1. file: [0ecee5dbb0] check-in: [deddd35e15] user: stephan branch: trunk, size: 31384
2021-07-09
22:06
Changed a bunch of predicate function signatures from returning char to bool (now that we're C99, we might as well own it). file: [7335ad754e] check-in: [9b35720349] user: stephan branch: trunk, size: 31737
2021-06-26
11:27
Renamed s2/*.c to remove the extraneous s2_ prefix. Unrelated touchups in t10n/*. file: [b51dba57d0] check-in: [3311efa964] user: stephan branch: trunk, size: 31737
09:30
Removed s2_rc_cstr() and s2_rc_cstr2(), now that we have cwal_rc_cstr_fallback(). file: [4713867153] check-in: [9bb5de51f2] user: stephan branch: trunk, size: 31740
2021-06-25
22:30
Initial go at removing s2_error class, now that that's been moved over to cwal_error. Seems to work but needs more testing to ensure that script location information is still correct when reporting errors. Also (only remotely related) removed the c9n-related bits from s2/ since that work is now going on over in t10n/. file: [783fef0ad7] check-in: [d69c75ff2a] user: stephan branch: s2-remove-err-obj, size: 31726
2020-08-29
11:18
Minor tinkering. file: [60b60a8125] check-in: [15ce4293d8] user: stephan branch: trunk, size: 36437
10:20
More work on c9n. file: [aaa9219b6d] check-in: [643ebbf14a] user: stephan branch: trunk, size: 36431
07:27
Removed nameLen member from the s2 tokenizer classes (over-engineering). More tweaking of the c9n bits but a path to consolidating them with t10n in s2_eval is no clearer now than it was a month ago. It might be time to fork off s2.5 or some such and port s2_eval.c over to c9n. Or maybe we could use a higher-level tokenizer/token abstraction to consolidate the two, rather than trying to hide c9n behind t10n. file: [ee39c85067] check-in: [711c9c3123] user: stephan branch: trunk, size: 35304
2020-08-27
10:43
Split S2_T_Heredoc (new) from the previously dual-nature S2_T_SquigglyBlock, which previously represented both {...} and heredocs, for historical tokenizer-level reasons. file: [5ba2d71cf6] check-in: [a0266ba0e4] user: stephan branch: s2-c9n-baby-steps, size: 35048
08:44
More small steps towards compiled s2 tokens, but valgrind is broked on this ARM environment, so cannot properly test. file: [7dd163908e] check-in: [ef3c0316b4] user: stephan branch: s2-c9n-baby-steps, size: 34854
2020-01-10
16:07
Refactored s2_ptoker::capture to use a range of 2 tokens rather than a byte range (for eventual compatibility with compiled tokens). Removed the new S2_T_Capture token type (today's refactoring made it obsolete). Fixed s2_ptoker_putback() to match what its docs say it does. Added a few s2_ptoker/s2_ptoken helper methods. file: [c94d9fef2a] check-in: [b5b26a5279] user: stephan branch: trunk, size: 34700
05:36
More work on the c9n bits. file: [befa3a7a7f] check-in: [f549020d74] user: stephan branch: trunk, size: 34673
2020-01-06
15:19
More work crawling towards compiled token chains. It's looking less and less as though it will gain us more than about 6-8% of execution speed, though, at least for the unit tests. We'll see (if the compiled version can be adequately hidden behind s2_ptoker, that is, but that's as yet uncertain). file: [a0e30ec956] check-in: [a071956dca] user: stephan branch: trunk, size: 34483
08:53
More work on the token chain compiler. file: [d452a73545] check-in: [be96c6e108] user: stephan branch: trunk, size: 34361
2020-01-05
13:58
Set out to start hiding s2_ptoker::token access from the public API, but that's not going to be realistic. Instead, some related minor touchups. file: [de387a8a7a] check-in: [8062c143b7] user: stephan branch: trunk, size: 32722
2020-01-04
12:43
More internal work headed towards experimenting with precompiled token chains (still am not sure that the tokenization APIs can be consolidate, though). Fixed a return in s2_eval_array_literal() which could, when interrupted or OOM, cause a scope-pop to be skipped, which would lead to all sorts of madness. Changed line/col counts from int to uint16_t. file: [2d5f3b38c0] check-in: [7206811f5e] user: stephan branch: trunk, size: 32721
2020-01-03
17:24
s2_ptoker::pbToken is now only used directly from s2_t10n.c. file: [4f8998b72f] check-in: [3cd2d8c8eb] user: stephan branch: trunk, size: 32602
10:28
Added s2_c9n.[ch] for later experimentation with "compiled" token chains. file: [f07272b9a6] check-in: [2e4da47393] user: stephan branch: trunk, size: 32463
2019-12-30
16:35
Added trace-assert and trace-token-stack pragmas. Related minor refactoring, symbol renaming, and docs. file: [9ea6552894] check-in: [6d39f4ad9f] user: stephan branch: trunk, size: 31232
2019-12-29
06:11
Minor fixes for non-debug building. Also noticed that the header of cwal's test.c still referred to it as a cson test app (from the very early origins of this tree). file: [2da1444a19] check-in: [51c47e20dd] user: stephan branch: trunk, size: 31192
2019-12-18
08:57
Doc typos and fixed a test which was, as intended, broken, but was broken in the wrong way. file: [0328ee5c2b] check-in: [aa535f370b] user: stephan branch: trunk, size: 31149
2019-07-06
07:21
Fixed core property lookup to always perform type-strict comparison if either the lookup key or property key is of type CWAL_TYPE_BOOL. Without this, X[true] was resolving to the first truthy property key, and X[false] to the first falsy one. file: [3d60e4d7cc] check-in: [a32fcc4268] user: stephan branch: trunk, size: 31149
2018-11-29
14:43
Minor tweaks caught while porting some of this code into another tree. file: [dc0ccb9b3a] check-in: [4398c5bec4] user: stephan branch: trunk, size: 30549
2018-11-23
14:43
Snapshot. Lots of cleanup of the new s2_scope mechanism. Removed some now-obsolete s2 scope-handling functions. file: [ed6e44bd75] check-in: [b7de2a8e38] user: stephan branch: scope-push-pop-hooks, size: 30454
12:26
Snapshot. The new scope push/pop mechanism is in place and working (it was tedious but surprisingly painless to do). Valgrind is happy, but there's still lots of API docs to fix, functions to rename, and memory cost comparisons with the trunk version to do. file: [74af674df8] check-in: [e07567160b] user: stephan branch: scope-push-pop-hooks, size: 30441
2018-11-20
09:05
Squelched dozens of unused parameter warnings (removing their names causes a completely different warning) triggered by work on the build process. Fixed cwal_scope_chain_set_with_flags() to not ignore the flags it was given and to honor various KVP/container flags which its _v() counterpart was honoring. file: [382f095bc1] check-in: [211af69f84] user: stephan branch: trunk, size: 30405
2017-12-25
10:49
Removed s2's hash-entries-via-dot-op feature from the public API, as it is a hotbet of corner/special cases and would like interfere with eventual interceptor support. We still use it internally for hash-backed enums. file: [7b77f6c0a6] check-in: [f97f326ffd] user: stephan branch: trunk, size: 30219
2017-11-12
10:49
Discovered and applied gcc's -Wextra warning level, plus patched up violations it caught (mostly missing struct member initializers). file: [4b67602251] check-in: [f13f6c3c4b] user: stephan branch: trunk, size: 30069
2017-10-12
14:51
tiny random renaming and auto-reformatting of docs. file: [948453803c] check-in: [1722d73841] user: stephan branch: trunk, size: 30087
12:11
Random tiny cleanups, auto-reformatting, and fixed (i think) CWAL_TYPE_LISTMEM allocation metrics tracking. file: [9fb8c54654] check-in: [d7ba485ecd] user: stephan branch: trunk, size: 30050
2016-09-09
19:21
Adding a preliminary CMakeLists.txt for use in CLion. Also changed the UNUSED_VAR macro to an UNUSED attribute which appears to be more widely adopted by compilers. file: [f42ed89211] check-in: [d834ba36b3] user: calebg branch: s2-ndebug, size: 29911
2016-09-02
13:43
Correctly disabled assert with NDEBUG and sprinkled even more UNUSED_VAR macros around. file: [111d684f65] check-in: [ebf7545c0b] user: calebg branch: s2-ndebug, size: 29960
2016-08-30
16:44
Fixing up the s2 non-debug build: * Switched around the amal build so that s2_amalgamation.* files can be used without including other files. * Replaced all debugging double negatives with just a positive expressions: "#if !defined(NDEBUG)" is now "#ifdef DEBUG" * Added the UNUSED_VAR macro to prevent the 'unused variable' compiler warning. * Removed the "force assert() to always work" sections in the shell.c and test.c files. * Added S2_AMALGAMATION_BUILD to test.c so that it's possible to easily build the test with the amal build. * Littered UNUSED_VAR everywhere it was needed. file: [df147f1f6a] check-in: [80f0382c88] user: calebg branch: s2-ndebug, size: 29954
2016-02-05
11:14
split up the s2 APIs into internal/public parts. file: [d00531fc3c] check-in: [efa2b6c8b8] user: stephan branch: trunk, size: 29886
2016-01-25
18:49
experimenting with cwal scopes copying const-flagged vars from parent scopes when a local lookup fails, but this can change script semantics, namely typeinfo(islocal...) and declaration of locals with the same name after a higher-up one has been copied in. file: [a188d0471e] check-in: [cb9e1ef96d] user: stephan branch: scopes-copy-consts-on-lookup, size: 29940
16:08
accommodated code changes which broke tests (exceptions which became syntax errors), changed a couple internal error codes related to improperly closed block constructs. file: [bb33b18240] check-in: [627ac957d3] user: stephan branch: trunk, size: 29877
2016-01-08
14:55
large batch of tweaks, largely related to the hash-vs-objects work, but also an attempt at guaranteeing under/overflow behaviour on integer ops. file: [43087e1ef2] check-in: [b79462d915] user: stephan branch: s2-scope-hashes, size: 29877
2014-10-11
12:23
s2: fixed a test broken by the previous round of changes. file: [fee89b107c] check-in: [ca71e5233e] user: stephan branch: trunk, size: 29396
2014-08-29
12:12
s2: experimenting with the ability to interrupt a running script, e.g. via Ctrl-C handler. Results look fairly promising but not perfect. Added Buffer|String.evalContents() and minor API changes to accommodate them. file: [15da709395] check-in: [cdf401e000] user: stephan branch: trunk, size: 29526
2014-08-23
15:51
core: consolidate integers and doubles into one recycling bin where there sizeofs are the same. Have to check it in to try it out on the 32-bit box (where they differ). file: [60b1d3ec78] check-in: [06a8a0df82] user: stephan branch: trunk, size: 29523
2014-07-16
22:55
s2 now takes over cwal's top-most scope. file: [71b7e9a633] check-in: [640daaf522] user: stephan branch: trunk, size: 29459
2014-07-10
19:07
s2: overhauled the scope subsystem, adding the s2_scope abstraction layer. Moved the sweep/vacuum guard levels, which are always scope-specific anyway, into that. Ooops - and i now see that the overloadable -> operator (which i thought was checked in last night) is also here. Wanted that done separately :/. file: [1ab177ca05] check-in: [f18c8ff4ed] user: stephan branch: trunk, size: 29236
2014-07-01
21:26
s2: ported in the Buffer class, a number of other tweaks. TODO: finish buffer unit tests. file: [6ecc9ce9fd] check-in: [5f6b5a8f85] user: stephan branch: trunk, size: 29255
2014-06-27
18:59
s2: more work on the semicolon changes, added 'continue' keyword, keywords are now looked up via bsearch(). file: [452e5a3496] check-in: [4b2b66692b] user: stephan branch: s2-semicolons, size: 29412
15:20
s2 now only recognizes semicolons and EOF as end-of-expr. Still some docs and EOL-handling to adjust, but this will free up the parser to allow more flexibility in user input. file: [2777e96059] check-in: [71fedaf534] user: stephan branch: s2-semicolons, size: 29431
2014-06-26
20:07
s2: fixed a null ptr deref and made (...) legal after 'obj.' again. Seems to work. file: [d73b7003d3] check-in: [70c41986eb] user: stephan branch: trunk, size: 29430
2014-06-25
21:44
s2: added if/else. Turned off string interning by default in the shell. file: [98698a078d] check-in: [5c27b8123d] user: stephan branch: trunk, size: 29416
2014-06-22
09:42
s2: added func/method call() support. This breaks obj.(prop) access, but that was arguable fluff, anyway, so it's been removed. file: [590d140439] check-in: [4c045a135e] user: stephan branch: trunk, size: 29414
2014-06-21
18:15
Added object literals (JS/JSON-like). {SquigglyStrings} are now always object literals unless context/a keyword changes that. file: [b98355efe7] check-in: [4f6e3866a8] user: stephan branch: trunk, size: 29463
14:50
s2: added PHP-style array-append operator, imported a bit more prototypes infrastructure, improved valgrind testing a bit. Added inherits operator. Keep forgetting to check in. file: [80cf6c5fab] check-in: [6e0c316928] user: stephan branch: trunk, size: 29530
2014-06-20
22:32
cleanups in s2 error reporting/handling. file: [d9a32a4e06] check-in: [336caed0e0] user: stephan branch: trunk, size: 29504
18:48
s2: fixed a newline-slurping bug which caused expressions to bleed together. Added infrastructure for propagating return/exit/break values. file: [daab67b136] check-in: [edd8c19dfc] user: stephan branch: trunk, size: 29182
2014-06-19
16:29
converted more tokenization errors to syntax errors. file: [d242743d74] check-in: [ebeaa3c5c6] user: stephan branch: trunk, size: 29199
15:45
More exception-vs-fatal error distinctions. Lots of tinkering with sweep-up, fixing some cleanup timings. file: [57bd5be5ce] check-in: [f3e77e10f9] user: stephan branch: trunk, size: 29274
10:10
bending around the s2 exception/error infrastructure a bit, in prep for throwing exceptions. file: [1434456ce5] check-in: [d7399dd09b] user: stephan branch: trunk, size: 28836
00:20
added var/const decl to s2. file: [cd611fffd0] check-in: [5e6e89ac41] user: stephan branch: trunk, size: 28842
2014-06-15
19:41
Seem to have gotten sweep-up working how i want it in s2. file: [b8c88182a8] check-in: [2239164d8f] user: stephan branch: trunk, size: 28892
15:12
Error reporting cleanups. {squigglies} may now contain only script-legal tokens, leaving heredocs as the generic catch-all string type. May want to re-think this limitation later. file: [92286d16d5] check-in: [41ebd75fbd] user: stephan branch: trunk, size: 28719
12:50
added very basic s2 shell (stdin only). Discovered some EOL-related problems along the way. file: [1f620614d4] check-in: [948fb7e49e] user: stephan branch: trunk, size: 28712
11:06
Started adding script name infrastructure to the error reporting. Fixed assert() to honor skip mode. file: [f1b5afc5ce] check-in: [c3edf01eca] user: stephan branch: trunk, size: 28702
09:28
More s2 refactoring/code moving, added assert keyword. Finally broke the 2kb RAM barrier with 67 allocs across 201 test scripts. file: [6a0ea9fccb] check-in: [9b23787767] user: stephan branch: trunk, size: 28536
07:50
ported in more prototypes stuff, but need to restructure for testing. file: [f79fe934e9] check-in: [5fe65e8b2a] user: stephan branch: trunk, size: 27683
2014-06-14
23:11
Cleanups in the ternary if support. Now catches more errors. file: [343e79db01] check-in: [5833192c10] user: stephan branch: trunk, size: 27630
21:35
s2 ternary if seems to work. file: [7d2bf8ef2f] check-in: [9bfa64c94b] user: stephan branch: trunk, size: 26871
20:11
seem to have gotten short-circuiting working in s2 for || and && ops. file: [6016b2426d] check-in: [d19a658b2d] user: stephan branch: trunk, size: 26238
17:10
added ||| ("Or3") operator (with JS || semantics) and changed || to use bool-only results (like most languages). file: [61e58e894a] check-in: [30af8e98c8] user: stephan branch: trunk, size: 25269
15:17
added null/undefined/true/false keywords to s2. file: [f5b8fab596] check-in: [423d1709df] user: stephan branch: trunk, size: 24974
14:05
Added first s2 keywords: eval and scope. file: [0b4aea988f] check-in: [339bd99521] user: stephan branch: trunk, size: 24470
11:32
more internal s2 refactoring. file: [978c195d59] check-in: [4e270a462d] user: stephan branch: trunk, size: 24125
10:38
minor s2 internal cleanups. Now at 125 test scripts in 2966 bytes of code, still 61 allocs for 2003 bytes :D. file: [d6e23b74b0] check-in: [2fb1767e8a] user: stephan branch: trunk, size: 24135
09:31
s2 now knows to ignore EOLs when looking for the RHS of binary operators. file: [1f44746e89] check-in: [9b37575656] user: stephan branch: trunk, size: 23916
2014-06-13
23:54
s2: got C/C++/JS-style array/property accessor working, including chaining :). 117 test scripts: only 61 allocs and 2003 bytes RAM (less than the 2850 bytes of script code) :D. file: [8d1ce69d1a] check-in: [81d973318a] user: stephan branch: trunk, size: 23762
19:10
ported in the major var/property APIs and some more infrastructure. Found a nice solution to the identifier-vs-string resolution problem, so OBJ.PROP works now. Fixed {squiggly} support i broke when fixing (parens|braces). file: [95e686acdd] check-in: [6b75da09a6] user: stephan branch: trunk, size: 22226
13:16
s2_ptoker_slurp_braces() now uses sub-tokenization instead of byte scanning so that braces in strings/heredocs do not confuse it. file: [b4c4a1ff6f] check-in: [fad74c7965] user: stephan branch: trunk, size: 20835
2014-06-12
22:35
More s2 (surprise!). Added initial OBJ.PROP support, but it currently just resolves to its RHS. file: [03c352e8cd] check-in: [1ef73de222] user: stephan branch: trunk, size: 20588
19:18
more minor s2 cleanups. Still under 1400 bytes of RAM for 96 test scripts :). file: [7fff53fd5a] check-in: [b40f7b88d8] user: stephan branch: trunk, size: 20027
16:54
refactored the eval-related code a bit to take a set of flags. Cleaned up test script output a bit. file: [2d787e41c9] check-in: [bbaf777cdd] user: stephan branch: trunk, size: 19412
2014-06-11
21:37
more s2 cleanups, mostly in syntax error detection. file: [5a3bec554b] check-in: [f0ceba8432] user: stephan branch: trunk, size: 19412
18:36
s2 (parens groups) are now tokenized/handled as a single value (via a sub-parse on the (...) byte range), eliminating paren counting/managing from the evaluation step entirely. Requires recursion, where we had none before, but this approach is much more flexible, i think/hope. Valgrind says 1229 bytes allocated for 87 test scripts (1866 bytes of code). file: [5be7676a34] check-in: [08e95ee9ee] user: stephan branch: trunk, size: 18278
16:47
minor s2 tweaks before trying more invasive changes. file: [c2c9aa8124] check-in: [767e218c1a] user: stephan branch: trunk, size: 18102
10:32
portability fixes in printf specifiers. file: [6111f8454f] check-in: [ac55d95cdb] user: stephan branch: trunk, size: 18058
2014-06-10
22:41
good night, s2. file: [796326eb7f] check-in: [a54e62f03c] user: stephan branch: trunk, size: 18025
21:49
Lots more s2 cleanups, touchups, pull-ups, and other forms of ups. Well, okay, no pull-ups. Chuck Norris already did all of those. Twice. Valgrind clocks in at 46 mallocs using 1240 bytes of RAM for 82 test scripts totaling 1737 bytes of script code on the ODroid (32-bit ARM). file: [866db1eb5a] check-in: [e9d18ebc18] user: stephan branch: trunk, size: 17977
19:24
Finally got the multi-semicolons behaviour i wanted wrt s2 eval. file: [cfee0877d0] check-in: [f0aa01005f] user: stephan branch: trunk, size: 35730
2014-06-09
17:15
more s2. added comparison ops. file: [00ce19f141] check-in: [cc3e8acbe2] user: stephan branch: trunk, size: 33859
12:52
more work on s2. added heredocs. cleaned up test code basis. file: [ae8a1f67f8] check-in: [11be7e573e] user: stephan branch: trunk, size: 31892
09:53
Added a mechanism for s2 to support th1ish-like 'adjusted' tokens, to support squiggly strings and heredocs. file: [2adf7263e7] check-in: [22641e8a72] user: stephan branch: trunk, size: 29174
2014-06-08
23:49
more work on s2... file: [9489d7412b] check-in: [0f0c7757be] user: stephan branch: trunk, size: 29146
15:22
more s2 refactoring towards the ability to tokenize single expressions at a time. file: [684450929e] check-in: [f1ccf9ad92] user: stephan branch: trunk, size: 33368
11:15
more s2 refactoring, working towards expression-level parsing and short-circuit skipping. file: [9d511ffcc2] check-in: [704cceeb3e] user: stephan branch: trunk, size: 22346
2014-06-07
18:34
Seem to have gotten the precedences working. For now. file: [1705125c7f] check-in: [74863c58b7] user: stephan branch: trunk, size: 19840
15:47
more tinkering with s2. file: [b7f55d9ea6] check-in: [245717259d] user: stephan branch: trunk, size: 19354
2014-06-06
23:20
more cleanups in the calculator. file: [1400094359] check-in: [982d16c897] user: stephan branch: trunk, size: 16664
22:17
s2 calculator is coming along. file: [89040ad23b] check-in: [6382ebced0] user: stephan branch: trunk, size: 14857
20:19
Got the most basic of calculator running in s2. file: [0f8bf573d5] check-in: [86a3a5181a] user: stephan branch: trunk, size: 13591
18:39
s2: got basic tokenizer in place. file: [c5c74c8504] check-in: [43c1df5ce8] user: stephan branch: trunk, size: 11112
2014-06-05
21:40
more s2 tinkering. bed time again. file: [91f344f627] check-in: [8078407025] user: stephan branch: trunk, size: 9501
20:46
more s2 refactoring. bed time. file: [b98ddb72e7] check-in: [41818e5b28] user: stephan branch: trunk, size: 9501
20:30
Added more s2 operators, fixed token recycling to actually recycle. file: [7fb136ef65] check-in: [0e2d36e2c3] user: stephan branch: trunk, size: 9606
18:26
Cleanups in s2, implemented multiply/divide/modulo ops. file: [a155327bc8] check-in: [b0e033e337] user: stephan branch: trunk, size: 7461
2014-06-04
22:09
implemented PoC unary/binary add/subtract ops in s2. file: [a18176b4c8] check-in: [e929071170] user: stephan branch: trunk, size: 5908
2014-06-03
22:32
Got some basic PoC in place for s2. file: [979334c889] check-in: [0e11ae0e16] user: stephan branch: trunk, size: 3869
20:53
Added: tinkering with some ideas for a stack-machine-based interpreter. nothing useful yet. file: [e162bc15a2] check-in: [f4eb30ae39] user: stephan branch: trunk, size: 3138