Commit Graph
23 Commits
Author SHA1 Message Date
Kyle Marek-Spartz 4cac6ce201 fix: remove redundant "Receiver" prefix from method-not-found error message
The error message for unimplemented methods previously included the word "Receiver"
before the class name, which was redundant and inconsistent with other error messages.
Updated the format string in `methodNotFound()` to drop "Receiver" and use the class
name directly. Added a new test case for static method not found errors and updated
existing test expectations to match the new message format.
2014-02-24 03:53:49 +00:00
Kyle Marek-Spartz d5a121d7da feat: include receiver class name in methodNotFound error messages
Add ObjClass* parameter to methodNotFound and pass classObj from all call sites in runInterpreter, so the error message displays the receiver's class name instead of a generic "Receiver does not implement method".
2014-02-22 07:20:53 +00:00
Kyle Marek-Spartz e9391313b7 style: remove space before parentheses in map and where method definitions in core.wren and generated wren_core.c 2014-02-18 17:54:55 +00:00
Kyle Marek-Spartz e6fb918cc7 style: remove spaces between method names and opening parentheses in Set class
Remove the extraneous whitespace separating method names from their parameter lists
across all method definitions in the Set class (add, remove, contains, iterate,
iteratorValue, map, where) to conform to standard Wren formatting conventions.
2014-02-17 20:17:54 +00:00
Kyle Marek-Spartz 9eecafaaac chore: add missing trailing newline at end of example/set.wren file 2014-02-17 20:15:55 +00:00
Kyle Marek-Spartz 60704171a2 fix: handle null iterator in Set.iterate to return first index or null for empty set 2014-02-17 20:15:44 +00:00
Kyle Marek-Spartz 86029c5123 docs: replace em dash with unicode character and semicolon with colon in two markdown files 2014-02-17 19:56:41 +00:00
Kyle Marek-Spartz ea57beeabc docs: swap title and site name order in HTML template for better tab readability 2014-02-17 04:02:04 +00:00
Kyle Marek-Spartz 6cfb8b1551 test: merge custom bitwise operator tests into existing operators test file 2014-02-17 01:42:49 +00:00
Kyle Marek-Spartz 9dfcf530db docs: add TODO note to refactor classes and method-calls documentation with operator examples 2014-02-17 01:31:10 +00:00
Kyle Marek-Spartz 9e88242ddf docs: add todo note about documenting static methods in classes section 2014-02-17 01:30:06 +00:00
Kyle Marek-Spartz 91f890e0cc docs: replace em dash, hyphenate compound adjective, and use colon in documentation 2014-02-17 01:28:40 +00:00
Kyle Marek-Spartz 59ce704a53 style: convert dart code block indentation from 4 to 2 spaces in variables.markdown doc 2014-02-17 01:27:11 +00:00
Kyle Marek-Spartz 5fef1a9865 feat: implement bitwise union and intersection operators in Set class
Uncomment and implement the `|` (union) operator to return a new Set combining both lists, and the `&` (intersection) operator to return elements present in both sets. Refactor the `+` operator to delegate to `|` for consistency with bitwise semantics.
2014-02-16 18:02:45 +00:00
Kyle Marek-Spartz 4f4251882d feat: enable custom bitwise operators | and & in wren compiler and add test
Add INFIX_OPERATOR entries for TOKEN_PIPE and TOKEN_AMP with PREC_BITWISE precedence in the compiler's grammar rules, replacing the previous UNUSED entries. This allows user-defined classes to implement custom `|` and `&` operator methods.

Include a new test file `test/custom_operators/bitwise.wren` that defines Amp and Pipe classes with their respective operator methods to validate the feature works correctly.
2014-02-16 18:01:40 +00:00
Kyle Marek-Spartz c289719b70 feat: add Set class with add, remove, contains, count, map, where, union, and set minus operations
Implement a generic Set data structure backed by a list with automatic deduplication via cleanup method. Includes core set operations: element addition/removal, membership testing, cardinality, functional transformations (map/where), union via + operator, and set difference via - operator. Also provides iteration support through iterate/iteratorValue methods.
2014-02-16 17:37:19 +00:00
Kyle Marek-Spartz 3b9478908f docs: update documentation examples to use uppercase IO instead of lowercase io 2014-02-16 17:28:56 +00:00
Kyle Marek-Spartz 5ccf0546c1 fix: correct spelling of "rivaling" and "carnival" in performance documentation
Fix two typos in doc/site/performance.markdown: change "rivalling" to "rivaling" in the paragraph about language implementation complexity, and change "carvinal" to "carnival" in the benchmarks section.
2014-02-15 23:12:18 +00:00
Kyle Marek-Spartz 35fbcc5b49 feat: add List.where method for filtering elements with predicate function
Implement a `where` method on the List class that takes a predicate function and returns a new list containing only elements for which the predicate returns true. The implementation iterates over the list, calls the predicate on each element, and collects matching elements into a new list. Includes test cases verifying filtering with both matching and non-matching predicates.
2014-02-15 06:42:14 +00:00
Kyle Marek-Spartz edaf529598 chore: replace IO.write with IO.print and fix array spacing in map test
- Change IO.write to IO.print for output consistency in map.wren test
- Add spaces after commas in array literal [1, 2, 3] to match style guide
2014-02-15 06:34:30 +00:00
Kyle Marek-Spartz 632cbf31b7 fix: correct typo in comment and remove redundant struct tag in Token definition 2014-02-15 06:15:51 +00:00
Kyle Marek-Spartz 48ef257973 feat: add List.map method with test for element transformation
Implement a `map` method on the List class that applies a given function `f` to each element, returning a new list with the transformed values. Includes a test case verifying incrementing each element by 1.
2014-02-15 05:06:29 +00:00
Kyle Marek-Spartz e690a48e45 feat: implement List concat operator + supporting Range and empty lists
Add `+` method to List class in core.wren that creates a new list by concatenating elements from both operands. Supports concatenation with Range objects and handles empty lists on either side. Includes comprehensive test cases in test/list/concat.wren covering list-list, list-range, and empty list combinations.
2014-02-14 17:09:02 +00:00