Commit Graph

57 Commits

Author SHA1 Message Date
Sage Vaillancourt 6dcec5a8c5 Fix forbble op order.
Add some demo functions and testing to forbble. Delete forbble_old.pbl
Check for "q" quit *after* REPL preprocessing.
Close file in readFileToObject().
2022-04-22 10:40:38 -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 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 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 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 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 fc4f0bef28 Move main() etc. into main.c 2022-04-05 20:05:58 -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 caaa6c53f6 Add simple object hashtable for env.
Currently has some issues with accessing parameters in recursive calls.
2022-04-04 14:15:44 -04:00
Sage Vaillancourt 13fa4ce54f More cd-related sugar.
Add preprocess pl func for repl.
Add basic aliases to repl.
2022-04-02 04:57:53 -04:00
Sage Vaillancourt 1a13fe4814 Add `unused` macro.
Prefer malloc() over calloc() in env.c
2022-04-01 15:07:19 -04:00
Sage Vaillancourt 980a1c42ab Add (cd) and (cwd).
Handle quotes in printColored().
2022-03-31 21:31:24 -04:00
Sage Vaillancourt b770a618e0 Simpler listEvalFunc() implementation.
Simpler simpleFuncEval(), which should eventually be removed, anyway.
 - Something with it or (reduce) is a bit leaky, but actually less so than before.
Small plfunc.c reordering.
2022-03-31 15:44:18 -04:00
Sage Vaillancourt 32e21bf758 Replace (struct's field) with (struct.field)
It was cute, but hard to read in space-delimited lists.
Convert (map) to a normal pl function.
Add trueObject() falseObject() macros.
2022-03-31 10:29:10 -04:00
Sage Vaillancourt b4e0f57029 Use (env "HOME") in pebblisp.pbl for reload.
Show current working directory in prompt.
2022-03-30 16:59:05 -04:00
Sage Vaillancourt b5f6a7d951 Add more colors to pebblisp.pbl
Plus a type comment on (time)
2022-03-30 16:54:17 -04:00
Sage Vaillancourt d76e3f5341 Make (def) a normal function.
Remove (defe) for now.
2022-03-30 16:32:42 -04:00
Sage Vaillancourt 342eba3a0d Add basic (time) function and Time struct.
Also add pebblisp.pbl config file to examples/
2022-03-30 16:04:30 -04:00
Sage Vaillancourt ce6c536567 Fix env memory bug.
Fix webby.pl::singleton.
Add basic-auth user/pw to Request plstruct.
2022-03-29 14:40:28 -04:00
Sage Vaillancourt a444bc11bb Use dynamically-sized strings for stringObj.
Fix webby.pl's `reduce` usage and web.c's struct creation.
2022-03-29 14:01:44 -04:00
Sage Vaillancourt 71623db37c Fix prnl in lib.pbl 2022-03-27 20:00:55 -04:00
Sage Vaillancourt e00d706522 Add function to read a file into a string object.
Move webby.pl into dedicate examples/web/ dir.
Pull out styles.css into its own file.
Fix small parseEval leak.
2022-03-24 16:59:58 -04:00
Sage Vaillancourt 097cbf6a5c Start some internal testing frameworking. 2022-03-21 12:33:57 -04:00
Sage Vaillancourt ee8eaf2d28 Fix web struct handling.
Typedef to handle different versions of libmicrohttpd.
Add getStructIndex().
Fix small print() mem leak.
2022-03-18 11:23:19 -04:00
Sage Vaillancourt b4584fa377 Start work on adding queryParams, etc. 2022-03-17 16:59:08 -04:00
Sage Vaillancourt 711719289f Several changes.
Add `reduce` and `islist`.
 - Reduce is broken with lambdas for some reason.
Remove `switch` from lib (breaks `penv`).
More detailed lambda to-stringing.
A bit of fixing for lambdas that return lambdas.
Re-org Object fields for simpler visual debugging.
Let `cat` work with one argument.
Add prompt option for `inp`.
Some more refinement of the webby.pl example.
2022-03-16 16:50:55 -04:00
Sage Vaillancourt 7faf2ebbb3 Add POST method.
Rename `addroute` to `get`.
2022-03-15 23:22:28 -04:00
Sage Vaillancourt f37969418d Add simple web server implementation.
Adjust global Environment implementation.
Example `webby.pl` is now a simple server program.
Only limit stringNObj outside of STANDALONE implementations.
Larger catObjects sizes.
Parsing files ignores semicolons inside of quotes.
2022-03-15 21:48:04 -04:00
Sage Vaillancourt a59ce1646f More comprehensive webby.pl
Allow for longer strings, but there's still another limiting element somewhere.
2022-03-15 16:03:23 -04:00
Sage Vaillancourt 1d5621923c Further flesh-out structs.
Temporarily disable http due to buggy Ubuntu libmicrohttpd.
Add a way to access their fields with `'s`.
 - Uses some fairly hacky parseAtom additions. Needs to be refined.
Add structCapacity to Environment.
Add global Environment pointer.
Use structDef indexes instead of direct pointers.
 - Easier to increase capacity this way
strcpy struct field names
2022-03-15 15:27:02 -04:00
Sage Vaillancourt 8d22bf575c Add history and ok/err functionality to REPL. 2021-12-15 14:40:49 -05:00
Sage Vaillancourt f3a69989fa Better switch functionality. 2021-12-15 14:39:13 -05:00
Sage Vaillancourt 49bf4aa1a2 Add system calls and some char processing.
Color REPL error output.
Add 'clear' shorthand to REPL.
Add basic switch to lib.
2021-12-10 16:38:44 -05:00
= a6f3fc96e6 Fixed bug where all func calls require an argument
Certain I/O functions (like `inp` or `repl`) do not need arguments, but
previously all functions required at least one argument to called correctly
(i.e. `(inp 0)` or `(repl "banana")`). Now, these can be called as intended:
`(inp)` or `(repl)`.
2021-07-13 21:46:15 +01:00
Sage Vaillancourt 811e9e3dd2 Breaking: Stop `def` adding vars to higher scopes
Fixed OOP error in allocating lambda environments. Add ability to disable test
groups. Disabled forbble tests and `switch` implementation (broken by `def`
change)
2021-07-12 20:34:54 -04:00
Sage Vaillancourt ce28c84696 Slightly better error-handling in Forbble 2021-07-12 20:13:02 -04:00
Sage Vaillancourt 77cb35f961 Add newline print to lib and use it in examples 2021-07-10 23:35:05 -04:00
Sage Vaillancourt 4974e87273 Disable Forbble REPL. Add Forbble-based tests 2021-07-05 05:09:32 -04:00