Commit Graph

286 Commits

Author SHA1 Message Date
Sage Vaillancourt d40e551933 Add dedicated plfunc directory.
Contains most native pl functions.
Consolidated pebcom into pebbleobject.
Broke out several pc (STANDALONE) and plstring functions into their own files.
2022-04-22 08:57:02 -04:00
Sage Vaillancourt 20f2d02f77 A bit of cleanup/simplification. 2022-04-22 07:37:25 -04:00
Sage Vaillancourt 1c52cb0ff1 Simplify some functions.
Remove some unused stuff.
Add macros for Lambda docString and reference access.
2022-04-21 12:01:02 -04:00
Sage Vaillancourt af65349d27 Simplify copyList and inline some of prepend(). 2022-04-21 11:43:07 -04:00
Sage Vaillancourt 9d2effe206 Better stringing. 2022-04-20 17:01:02 -04:00
Sage Vaillancourt d825ca3fe2 Add fib to forbble.
Add git branch to pl prompt.
Fix readFileToString() for empty files.
2022-04-19 20:43:53 -04:00
Sage Vaillancourt a47e280c76 Forbble tests are back on the menu. 2022-04-19 17:00:40 -04:00
Sage Vaillancourt bd6b26331b A crumb of cleanup. 2022-04-19 16:53:39 -04:00
Sage Vaillancourt 11525e9531 More (table) use in Forbble2.
Clean objects when adding duplicates to a hash table.
Type-check hash functions.
Add (switch) (first-where) and (match) to lib.pbl.
Support escaping in (standalone) strings.
2022-04-19 15:18:29 -04:00
Sage Vaillancourt b26771d33c Fleshing out ObjectTableObject.
Also fleshing out forbble2.
Fix _readFile() memory leak.
2022-04-18 22:17:17 -04:00
Sage Vaillancourt 8e30b24e8f Start work on hash-table objects. 2022-04-18 16:59:35 -04:00
Sage Vaillancourt 4ea3b1d36d Start work on forbble2.
Keep the old version around for now.
Add (indexOf) and (split) to lib.pbl
Distinct addToEnv() and setInEnv().
Add .clangd to gitignore.
2022-04-18 15:37:34 -04:00
Sage Vaillancourt 04b7e7b64a Centralize/simplify file-reading.
Handle comments at the token level.
2022-04-18 11:18:43 -04:00
Sage Vaillancourt f458b52a17 Add refcount to StaticFunction.
Small appendf() macro for object-stringing.
2022-04-18 09:59:57 -04:00
Sage Vaillancourt b0e89cafd4 Toying with a more optimized function representation.
Starting with just struct accesses.
2022-04-14 16:05:46 -04:00
Sage Vaillancourt 83b1b9212e Fix no-context error-handling.
Centralize parts of number-parsing.
2022-04-14 16:04:25 -04:00
Sage Vaillancourt 3f4d8fd7af Start dropping support for semicolon separators.
Simplify some error functions.
Oh, right. strdup() exists.
2022-04-14 00:31:51 -04:00
Sage Vaillancourt e326af38f8 Allow number indexing of struct fields.
Better error messages on failed struct access.
2022-04-13 16:57:58 -04:00
Sage Vaillancourt 80255af52e Split up some of the native testing code.
Makes running specific tests a little cleaner.
2022-04-13 16:48:37 -04:00
Sage Vaillancourt 54410030f7 Add throw() macro.
Simplifies the creation of complex error messages.
2022-04-13 15:17:59 -04:00
Sage Vaillancourt 9415b27f41 Add struct-handling to (?)
Move several functions from pebblisp.pbl to lib.pbl.
pebblisp.pbl aliases replace the start of a command, rather than exact match.
2022-04-13 15:17:46 -04:00
Sage Vaillancourt d9d2bca8c8 Some optimization attempts in progress.
Toying with a more efficient native-function-use implementation.
Replace getErrorCode with a macro.
Store initial slice array on the stack, mallocing at the end.
2022-04-12 22:42:41 -04:00
Sage Vaillancourt 0fd58832bf Fix some promise memory handling.
Adjust disabled-test printing in `?`.
Disable part of async testing (with comment explanation).
2022-04-11 21:42:00 -04:00
Sage Vaillancourt 96d759a7e6 Merge branch 'master' of https://gitlab.com/sagev9000/pebblisp 2022-04-11 20:44:38 -04:00
Sage Vaillancourt 48b1f3c54b Correcting some REPL behavior.
Add BuildListNamed() macro for optimized list creation.
2022-04-11 20:43:45 -04:00
Sage Vaillancourt 40506fd6b2 Fix more async leakage. 2022-04-11 16:49:48 -04:00
Sage Vaillancourt 7b014ebafa Fix (reduce) with lambdas.
Fix await memory leak.
Allow running specific tests with --run-test x (for valgrinding).
2022-04-11 16:38:49 -04:00
Sage Vaillancourt 5a34bcbfbd Add setGlobal() call to calc.c
Add vgcore files to gitignore.
Add tags alias to pebblisp.pbl
2022-04-09 17:24:18 -04:00
Sage Vaillancourt 9d46a618b6 Tweak strlen checks. 2022-04-08 20:16:34 -04:00
Sage Vaillancourt c1580523ee Have (eval) use global scope.
Add simple (run) (stdout) and (stderr) to pebblisp.pbl
2022-04-08 16:30:15 -04:00
Sage Vaillancourt 85fb91b4ed Use stripped Objects in hash.c
These lack the unused .forward field, reducing table memory by ~25%.
Also bump Object.number up to a long, and add a generic Object.data field.
2022-04-08 11:49:14 -04:00
Sage Vaillancourt 13d1168401 Wire up basic readline history/completion. 2022-04-08 10:23:12 -04:00
Sage Vaillancourt 056ea9eb13 Implement simple fn docstrings.
Adds usage of this new feature for pebblisp.pbl's (alias).
2022-04-08 00:36:12 -04:00
Sage Vaillancourt 9abec12d99 Implement loadfile in lib.pbl 2022-04-08 00:01:58 -04:00
Sage Vaillancourt a2b0e0813b Have `?` fall back to stringObj.
Note that ->forward is not used once an Object is in the environment.
2022-04-07 23:56:03 -04:00
Sage Vaillancourt 03d3247be3 Clean us tests.sh
Use EDITOR in pebblisp.pbl config alias.
Toying with a promptUpdater function.
2022-04-07 16:43:05 -04:00
Sage Vaillancourt 6f82567e41 No special handling for math operator tokens. 2022-04-07 14:29:35 -04:00
Sage Vaillancourt 7a0433aa68 Add funcyEval() for equivalent Func/Lambda eval.
Still a bit buggy.
Some general renaming for clarification.
2022-04-07 01:20:59 -04:00
Sage Vaillancourt 4baf7e011b Handle all HASHLESS details in hash.c 2022-04-06 20:12:26 -04:00
Sage Vaillancourt 4d215b1b79 Add simple sigint handler for repl.
inline evalLambdaArgs() and evalBuiltIns()
2022-04-06 16:55:49 -04:00
Sage Vaillancourt abaf3a1ddc Use plfunc name in type-error messages.
Previously used the name of the C function.
2022-04-06 09:55:31 -04:00
Sage Vaillancourt deca6045ff More useful type-error messages.
BAD_PARAMS_ON -> BAD_PARAMS
Replace printType() with getTypeName().
Use --ignore-config in testing.
Add type-checking (and missing clone) to (await).
2022-04-06 09:51:53 -04:00
Sage Vaillancourt 99a9b9a2b6 Make threading tests more brief. 2022-04-06 00:05:30 -04:00
Sage Vaillancourt 67691e36bc Fix Promise env longevity. 2022-04-06 00:03:34 -04:00
Sage Vaillancourt b54b93c7d1 Add simple Promise type.
A bit unstable. Almost certainly needs some locking on struct Promise fields.
2022-04-05 23:53:17 -04:00
Sage Vaillancourt fc4f0bef28 Move main() etc. into main.c 2022-04-05 20:05:58 -04:00
Sage Vaillancourt 5ca9fdb042 Tweak (penv) formatting.
Remove unused include from hash.c
2022-04-05 16:53:21 -04:00
Sage Vaillancourt 61b9f79c36 Pull segfault-handling into a dedicated function and ifdef.
Some stringing tweaks.
2022-04-05 16:41:23 -04:00
Sage Vaillancourt b419826b8e More robust addToTable().
Add several pl string functions: `slen`, `chars`, `matches`, and `substr`.
Add support for comments in native tests.
2022-04-05 15:30:30 -04:00
Sage Vaillancourt eb2dde72e3 Small envForLambda() fix.
All tests are passing now, though there may still be a small leak.
2022-04-04 21:08:18 -04:00