Commit Graph
16 Commits
Author SHA1 Message Date
Kyle Marek-Spartz 55b9c5537e fix: add prep target to .PHONY declaration in Makefile 2015-01-18 02:20:05 +00:00
Kyle Marek-Spartz d2cbb7a04b fix: remove trailing semicolon from DECLARE_BUFFER macro template
The DECLARE_BUFFER macro in src/wren_utils.h had an extraneous semicolon at the end of the wren##name##BufferWrite function declaration. This caused a double-semicolon issue when the macro was expanded in source files, as the macro invocation sites already added their own semicolons. Removing the trailing semicolon from the macro template ensures consistent and correct C syntax across all buffer type declarations.
2015-01-13 02:16:06 +00:00
Kyle Marek-Spartz 57ad565b64 fix: correct spelling of "brethren" in two documentation files 2015-01-12 23:39:41 +00:00
Kyle Marek-Spartz 8e54d6b21f fix: correct typo "unvalid" to "invalid" in error-handling documentation 2015-01-12 23:27:35 +00:00
Kyle Marek-Spartz c0d04de818 fix: add missing semicolons to DEFINE_BUFFER invocations and macro definition
The commit adds missing semicolons to three DEFINE_BUFFER calls in wren_utils.c and wren_value.c, and also adds a semicolon to the DECLARE_BUFFER macro definition in wren_utils.h to ensure proper syntax termination. Additionally, it removes trailing whitespace on two blank lines in wren_value.c.
2015-01-12 23:23:37 +00:00
Kyle Marek-Spartz 1175d93efa fix: allow compiler to continue after super used outside method body
Previously, when `super` was used at the top level or outside any method, the compiler would error but still attempt to read `enclosingClass->methodLength` and `enclosingClass->methodName` from a NULL pointer, leading to undefined behavior. This restructures the error handling in `super_()` to always call `loadThis()` and guard the unnamed super call path with a NULL check on `enclosingClass`, setting an empty method signature when no enclosing class exists. Two additional test cases for `super.foo("bar")` and `super("foo")` are added to verify the compiler continues past the error without crashing.
2015-01-11 23:43:51 +00:00
Kyle Marek-Spartz b949886707 feat: add contains method to List and update Set example to new operator syntax
Add a `contains(element)` method to the `List` class in the core library,
enabling linear search for an element across all list items. Update the
`example/set.wren` file to use the new Wren operator syntax for `|`, `+`,
`&`, and `-` methods, replacing old function-style parameter definitions
with block-style closures. Also fix trailing whitespace throughout the
Set example and embed the new `contains` method into the C source string
in `src/wren_core.c` for the built-in List class.
2015-01-09 22:02:40 +00:00
Kyle Marek-Spartz dd0760a54c fix: guard super() compilation against null enclosingClass to prevent segfault
When `super` is called at top-level with no arguments, `enclosingClass` is null, causing a segfault when trying to access its method name. This fix wraps the unnamed super call logic inside an else branch that only executes when `enclosingClass` is non-null, and adds a test case for the unnamed `super` call at top-level.
2015-01-09 21:14:06 +00:00
Kyle Marek-Spartz a132bca534 fix: switch Google Fonts link to protocol-relative URL in template.html
Remove the explicit `https:` scheme from the Google Fonts stylesheet href in
`doc/site/template.html` to avoid mixed content warnings when the site is served
over HTTP and to allow the browser to automatically use the same protocol as the
page.
2015-01-09 15:25:06 +00:00
Kyle Marek-Spartz 9a0ead8fec fix: switch Google Fonts stylesheet URL from http to https to resolve Firefox Mixed Content errors 2015-01-09 01:57:15 +00:00
Kyle Marek-Spartz 74a6b32d7f docs: fix typo in expressions documentation changing "they behavior" to "their behavior" 2015-01-08 15:32:50 +00:00
Kyle Marek-Spartz 1180516d0c style: adjust print formatting in benchmark output for consistency 2015-01-06 23:57:57 +00:00
Kyle Marek-Spartz 3127ea9c68 fix: alert missing interpreter in run_trial instead of crashing on OSError
Wrap the subprocess.check_output call in a try-except block for OSError. When the interpreter binary is not found, print a user-friendly message and return None from run_trial rather than letting the exception propagate and halt the benchmark run.
2015-01-06 22:49:09 +00:00
Kyle Marek-Spartz f26801dc6e feat: add benchmark file metrics tracking with line and TODO counters
Add four new counters (num_benchmark_files, num_benchmark_todos, num_benchmark_empty, num_benchmark) and a walk over the benchmark directory to count .wren files, empty/non-empty lines, and TODO patterns. Print the new benchmark section after the existing test output.
2015-01-06 22:20:52 +00:00
Kyle Marek-Spartz 9ec401bdc9 fix: convert print statements to functions and add future import for Python 3 compatibility 2015-01-06 22:20:21 +00:00
Kyle Marek-Spartz 864a70abdf feat: make Python scripts compatible with both Python 2 and 3
Update print statements to function syntax, add from __future__ import print_function in test.py, change shebangs to /usr/bin/env python, replace str.translate with re.sub for anchor sanitization in generate_docs.py, and decode subprocess output to utf-8 in test.py for cross-version string handling.
2015-01-06 02:09:23 +00:00