This website requires JavaScript.
Retoor software development
Projects
Research
SearchXNG
Register
Sign In
8 lines
56 B
Plaintext
Raw
Normal View
History
Unescape
Escape
feat: implement class method definition and instance creation in compiler and VM Add method parsing and compilation in `statement()` for class bodies, including symbol interning and block constant emission. Introduce `addConstant()` helper in compiler.c. Extend VM with `CODE_METHOD` opcode, `ObjInstance` type, `makeInstance()` factory, metaclass support in `makeClass()`, and `getSymbolName()` for symbol table lookup. Update vm.h with new type enum, struct definitions, and function declarations.
2013-10-25 06:32:17 +02:00
class Foo {
bar {
123
}
feat: add ObjBlock type, block compilation, and newline skipping in parser Introduce a new ObjBlock object type with OBJ_BLOCK tag, replacing the placeholder OBJ_NUM in makeBlock(). Refactor the compiler to separate Parser and Compiler structs, adding skipNewlines and hasError fields to Parser and a parent pointer to Compiler for nested block support. Implement compileBlock() function that compiles a block up to a specified end token, and update callBlock() in the VM to push empty slots for local variables. Adjust token reading functions to accept Parser instead of Compiler, and remove the MAX_TOKEN enum entry.
2013-10-24 21:39:01 +02:00
}
feat: implement class method definition and instance creation in compiler and VM Add method parsing and compilation in `statement()` for class bodies, including symbol interning and block constant emission. Introduce `addConstant()` helper in compiler.c. Extend VM with `CODE_METHOD` opcode, `ObjInstance` type, `makeInstance()` factory, metaclass support in `makeClass()`, and `getSymbolName()` for symbol table lookup. Update vm.h with new type enum, struct definitions, and function declarations.
2013-10-25 06:32:17 +02:00
var a = Foo.new
a.bar
Reference in New Issue
Copy Permalink
406826a980
wren
/
example
/
hello.wren