feat: add foreign method binding infrastructure with IO library integration

Implement the `WrenBindForeignMethodFn` callback type and `bindForeignMethodFn` configuration field to allow host applications to resolve foreign method declarations at class definition time. Refactor the IO library to use this new binding mechanism instead of the previous `wrenDefineStaticMethod` approach, adding `foreign` keyword support to the lexer and compiler. Introduce `freeCompiler` helper for cleanup, store module names in `ObjModule`, and update the VM to call the binder when processing `CODE_METHOD_INSTANCE` and `CODE_METHOD_STATIC` opcodes for foreign methods.
This commit is contained in:
Bob Nystrom
2015-03-24 14:58:15 +00:00
parent 80b24b50e8
commit a350d7c26a
11 changed files with 165 additions and 131 deletions
+2 -2
View File
@@ -28,8 +28,8 @@ Some people like to see all of the reserved words in a programming language in
one lump. If you're one of those folks, here you go:
:::dart
break class else false for if in is new null
return static super this true var while
break class else false for foreign if in is new
null return static super this true var while
## Identifiers