Commit Graph
3 Commits
Author SHA1 Message Date
Stephen Belanger 7913424c1c feat: replace generic BufferFind with dedicated hasMethod for duplicate detection
Replace the generic `wrenIntBufferFind` function with a specialized `hasMethod` helper that performs exact method symbol matching in the compiler. This change removes the generic `BufferFind` macro from the buffer utility system and introduces a focused implementation in `wren_compiler.c` that directly compares method symbols using `memcmp`. The error message for duplicate methods is also simplified to exclude the module name. Additionally, a new test file `duplicate_methods.wren` is added to verify error handling for duplicate instance and static method definitions.
2016-03-13 03:14:19 +00:00
Stephen Belanger b9b9611a8c fix: replace SymbolTable with IntBuffer for per-scope duplicate method detection 2016-02-28 20:53:34 +00:00
Stephen Belanger ed94957e91 feat: add duplicate method detection in class compiler with error reporting
Introduce a `methods` symbol table and `name` field to `ClassCompiler` struct to track method signatures during compilation. When a method is defined, check for existing entries in the table and emit a compile error if a duplicate is found, preventing silent method overrides. Initialize the class name string before class definition processing to support error messages referencing the class name.
2016-02-24 06:07:08 +00:00