Commit Graph
29 Commits
Author SHA1 Message Date
underscorediscovery a3f679c204 fix: rename static call to call_fn in wren_core.c to avoid symbol collision with wren_compiler.c during amalgamation 2019-09-18 07:08:07 +00:00
underscorediscovery 771b06aba7 fix: cast strtoll result to double in makeNumber to suppress MSVC C4244 warning
When parsing hex numeric literals, the return value of strtoll (__int64) is
implicitly converted to double via the NUM_VAL macro. This adds an explicit
cast to double to silence the MSVC warning C4244 about potential loss of data
from a 64-bit integer to a double.
2019-09-18 07:05:16 +00:00
Sven Bergström 92419c79cd docs: clarify modulus operator sign behavior in num.markdown
The floating-point remainder operator % now explicitly documents that the
returned value retains the sign of the dividend (this), matching the
behavior of C's fmod function. This addresses issue #695 by removing
ambiguity about sign handling in the modulus documentation.
2019-09-18 05:27:47 +00:00
Sven Bergström 0dea2bf922 docs: clarify Wren field encapsulation rules with examples and bold emphasis
The documentation for class encapsulation is updated to remove the comparison to C++ and Java from the initial description, add bold formatting to key getter/setter explanations, and include a new code example demonstrating that fields are private to instances and inaccessible from subclasses or other instances of the same class.
2019-09-18 05:18:55 +00:00
Sven Bergström 1577a59e27 fix: abort fiber when foreign class allocation raises runtime error
Add runtime error check after foreign object allocation in the interpreter loop to properly propagate fiber aborts triggered inside foreign class allocators. Previously, calling wrenAbortFiber from an allocate callback would set the fiber error state but the interpreter would continue execution, ignoring the abort. The fix adds a wrenHasError check after createForeign call, jumping to the runtime error handler if an error was raised.

Also adds a test case with a BadClass foreign class whose allocator calls wrenAbortFiber, verifying the fiber correctly catches and returns the error message "Something went wrong".
2019-09-17 18:08:37 +00:00
Sven Bergström b471a4cd16 fix: free temporary result buffer after path normalization to prevent memory leak in pathNormalize 2019-07-01 14:40:14 +00:00
Sven Bergström 585133b2c8 fix: correct broken relative link to maps overview page in map class documentation 2019-04-09 22:46:38 +00:00
Sven Bergström 39ffe8100a docs: update Visual Studio solution path from msvc2013 to vs2017 in getting-started guide 2019-03-24 21:09:24 +00:00
Sven Bergström 2fffc18e01 docs: update NaN tagging comment link to point to new file path and line range in wren_value.h 2019-03-24 15:03:52 +00:00
Sven Bergström 97336a1522 fix: disable 32-bit macOS build and remove i386 arch from CI and libuv
- Remove i386 from ARCHS in build_libuv.py to stop building 32-bit universal binary
- Drop ci_32 from CI_ARCHS in .travis.yml to skip 32-bit CI runs
- Add XCBuildData cache directory to .gitignore for macOS Xcode build artifacts
2019-02-12 07:33:05 +00:00
Sven Bergström e92626200f fix: update wrenInterpret calls in embedding docs to include module name parameter 2019-02-12 07:32:40 +00:00
Sven Bergström 920eae5638 fix: guard backslash advance in REPL lexer to prevent crash at end of input 2019-02-12 06:58:06 +00:00
underscorediscovery 24ff196b57 fix: correct twitter handle from @munificent to @munificentbob in hello-wren blog post 2019-02-08 04:40:44 +00:00
underscorediscovery 16da2393a6 docs: add rss feed link and twitter handles to hello-wren blog post footer 2019-02-07 21:07:21 +00:00
underscorediscovery 4a0e60236e docs: fix grammar and punctuation in hello-wren blog post
Correct "in a local projects" to "in local projects", add missing comma after "2.5+ years", and adjust parenthetical phrasing for clarity in the second paragraph of the Wren introduction blog.
2019-02-06 03:39:38 +00:00
underscorediscovery dbdabcca76 docs: replace all munificent/wren GitHub URLs with wren-lang/wren across docs and site templates 2019-02-06 02:41:31 +00:00
underscorediscovery 960f64d599 docs: add list concatenation operator documentation with examples in lists and core/list pages 2019-02-06 02:18:38 +00:00
underscorediscovery d0666f5a14 docs: add logo to sidebar, fix footer positioning, and switch to em units for responsive consistency 2019-02-06 02:18:24 +00:00
underscorediscovery 310213e4b2 docs: add blog section with hello-wren post, index, rss feed and template 2019-02-06 02:15:29 +00:00
underscorediscovery d4357e20db feat: add static file and RSS copy step to doc generator, handle escaped HTML entity in output formatting 2019-02-06 02:14:34 +00:00
Sven Bergström ebeb107b23 fix: pass extensions as keyword argument to markdown.markdown in generate_docs.py
The markdown.markdown() call was passing extensions as a positional argument,
which is deprecated in newer versions of the Python-Markdown library. This
change wraps the extensions list in the explicit 'extensions' keyword argument
to ensure compatibility with the current API and suppress deprecation warnings
during documentation generation.
2019-02-05 01:57:52 +00:00
Sven Bergström 1fa24240ed fix: correct broken relative link for runtime error documentation in embedding index
The link target for "runtime error" reference was pointing to a flat file path
`error-handling.html` which would fail when the page is served from a subdirectory.
Changed to `../error-handling.html` to properly resolve relative to the current
`embedding/` directory path.
2018-12-19 22:06:30 +00:00
Sven Bergström a40afb23c2 fix: update broken documentation links from munificent.github.io to wren.io
Replace all outdated reference links in README.md that pointed to the deprecated
munificent.github.io/wren domain with their current equivalents on wren.io,
covering syntax, performance, classes, concurrency, embedding, getting-started,
and contributing pages.
2018-11-26 20:05:42 +00:00
underscorediscovery a86e8158e4 feat: add natural logarithm method to Num class with C binding and test
Implement the `log` method on Num by adding a DEF_NUM_FN(log, log) macro invocation in wren_core.c, registering the corresponding primitive `num_log` on the numClass, and creating a new test file test/core/number/log.wren that validates positive and negative input behavior.
2016-10-31 19:52:32 +00:00
underscorediscovery 8b9f99663b feat: add pow(_) primitive to Num class for exponentiation
Implement the `num_pow` primitive that wraps C's `pow()` function, enabling
exponentiation on Num instances via the `pow(_)` method. Register the new
primitive in `wrenInitializeCore` and add a test file verifying basic cases:
2^4=16, 2^10=1024, and 1^0=1.
2016-10-31 19:52:13 +00:00
underscorediscovery 84a14cde08 chore: add Sven Bergström to AUTHORS file for project contributions 2016-10-31 19:51:55 +00:00
underscorediscovery 0b1a3cc3e5 feat: add string indexOf with startIndex parameter and update wrenStringFind signature
Add a new primitive `string_indexOf_with_startIndex` that accepts a second integer argument to specify the starting position for the search. Modify the existing `wrenStringFind` function to accept a `startIndex` parameter, updating its Boyer-Moore-Horspool algorithm to begin scanning from the given offset. Update the `string_contains` primitive to pass `0` as the start index. Register the new overloaded method as `indexOf(_,_)` on the string class and add test cases covering boundary conditions and out-of-range start indices.
2016-07-14 03:53:01 +00:00
Sven Bergström aa6f105a53 fix: correct broken link to ranges introduction in Range class docs
The previous link pointed to a non-existent ../range.html page. The corrected link now points to the proper anchor #ranges within the values documentation page, ensuring readers can access the friendly introduction as intended.
2016-05-21 02:54:41 +00:00
Sven Bergström 995fc241e6 docs: fix iterator protocol link to use relative path from core/ module docs 2016-05-21 02:51:47 +00:00