You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add extern type / extern fn parsing and codegen (closes#42)
extern was not a recognised keyword, causing a parse error at character 1 of
any file containing extern declarations. Adds:
- Token.EXTERN in lib/token.ml
- ("extern", EXTERN) in the lexer keyword table (lib/lexer.ml)
- TopExternType { et_name } and TopExternFn { ef_name; ef_params; ef_ret_ty }
variants in the AST (lib/ast.ml)
- extern_type_decl and extern_fn_decl parser rules in lib/parser.mly;
both added to the top_level production
- gen_decl cases in lib/codegen.ml: TopExternType is a no-op (opaque type
for the type-checker); TopExternFn adds a Wasm import with module "env"
and registers the name in func_indices so call sites resolve correctly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments