Commit Graph
18 Commits
Author SHA1 Message Date
Luchs b606dd20d4 feat: add syntax.wren example file for testing syntax highlighters
Add a comprehensive Wren language syntax example file covering class definitions, constructors, methods, fields, reserved words, literals, and control flow constructs. The file includes nested comments, static methods, setters, imports, foreign declarations, and various variable naming conventions to exercise syntax highlighting capabilities.
2015-04-25 16:10:17 +00:00
Luchs b4caca05fd fix: adjust amalgamation script to handle X Macro headers with conditional include guards 2015-04-16 12:40:17 +00:00
Luchs 641402a974 feat: prepend LICENSE text as commented header in amalgamation script output 2015-04-16 12:39:39 +00:00
Luchs 3f066d4e92 chore: add begin/end file comments to amalgamation generator output
Add `// Begin file "..."` and `// End file "..."` comment markers around each included file's content in the generated amalgamation output, improving traceability of source origins. Also refactor imports to use `os.path.basename`, `dirname`, and `join` directly, and replace `sys.stdout.write` with a module-level `out` variable for cleaner output handling.
2015-04-16 11:17:38 +00:00
Luchs a56c277473 fix: correct broken link to wren.h in embedding-api documentation
The link previously pointed to the old include/wren.h path but the file was moved to src/include/wren.h. Updated the URL in doc/site/embedding-api.markdown to reflect the new location.
2015-04-03 22:51:42 +00:00
Luchs 3373ae0296 fix: cast subtraction to int before abs to suppress clang 3.5 -Wabsolute-value warning 2015-04-01 15:42:20 +00:00
Luchs 628bf7ab1c feat: add amalgamation generation script and Makefile target for wren.c
Introduce a Python script that concatenates all Wren library source files into a single amalgamation file, resolving local `#include` directives recursively to eliminate internal header dependencies. Add a corresponding `wren.c` Makefile target that invokes the script on the core header and VM sources, along with `.DELETE_ON_ERROR` to clean up on failure.
2015-03-26 20:21:41 +00:00
Luchs 1cd91a52b4 fix: rename builtin static variables to avoid linker ambiguity across modules 2015-04-16 11:07:14 +00:00
Luchs 167ad288f0 fix: undefine READ_BYTE and READ_SHORT macros after use in wren_debug.c and wren_vm.c
The READ_BYTE and READ_SHORT macros are defined locally within functions
in wren_debug.c and wren_vm.c but were not being undefined after use,
causing potential redefinition warnings or errors when these macros
conflict with other definitions in the same translation unit. This
change adds #undef directives at the end of dumpInstruction in
wren_debug.c and runInterpreter in wren_vm.c to properly clean up
the macro definitions.
2015-03-26 20:16:43 +00:00
Luchs 205bf6d596 refactor: rename static callFunction helper to callFn to avoid name collision with public API
The static helper `callFunction` in wren_core.c was renamed to `callFn` to prevent symbol conflicts with the public `wrenCallFunction` API, ensuring unique linkage and clearer separation between internal and external call paths.
2015-03-26 19:42:20 +00:00
Luchs a1fa51459d docs: correct reduce documentation to state it works on non-empty lists instead of requiring two or more elements 2015-01-16 08:53:20 +00:00
Luchs 6530926aab docs: add Lukas Werling to AUTHORS file
Add Lukas Werling's name and email address to the project's AUTHORS file,
inserting the new entry after the existing contributor Gavin Schulz.
2015-01-16 08:53:14 +00:00
Luchs 6ac4e99b55 test: add string concatenation test for reduce with folding order
Add test cases demonstrating that the reduce function works with string arrays
and concatenation, verifying both with and without initial accumulator values.
The test uses a list of characters ["W", "o", "r", "l", "d"] and the existing
sum function to show that reduce correctly folds strings in order.
2015-01-16 08:48:59 +00:00
Luchs b25c181b7b feat: add reduce test for range covering sum and min with initial value
Add a new test file `test/range/reduce.wren` that validates the `reduce` method on numeric ranges. The test exercises two cases: summing integers 1 through 10 (expecting 55) and finding the minimum value with an initial accumulator of 100 (expecting 1).
2015-01-16 08:33:23 +00:00
Luchs a05dc9d733 feat: add test for reduce on empty list expecting runtime error 2015-01-16 08:29:45 +00:00
Luchs fb14301967 feat: implement single-argument reduce with manual iteration and empty-sequence abort
Replace the previous slice-based single-argument reduce implementation with an explicit iterator loop that seeds from the first element. This avoids the out-of-bounds range error on single-element lists and adds a Fiber.abort for empty sequences. Update the test to verify correct behavior for single-element and empty sequences.
2015-01-16 08:24:18 +00:00
Luchs 6cc513f13c docs: add documentation for reduce function variants in core-library 2015-01-15 15:38:11 +00:00
Luchs afa0a0a8e9 feat: add reduce method to Sequence with two overloads and tests
Implement `reduce` on the `Sequence` class in core.wren with two overloads: one taking an initial accumulator and a function, and another using the first element as the initial accumulator. Add three test files covering normal reduction, single-element edge case, and wrong arity error.
2015-01-15 15:29:49 +00:00