-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from WebAssembly/factor-signature
Move signatures into module types table
- Loading branch information
Showing
13 changed files
with
238 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
open Source | ||
open Types | ||
open Ast | ||
|
||
let print vs = | ||
List.iter Print.print_value (List.map (fun v -> Some v) vs); | ||
None | ||
|
||
let match_import i = | ||
let {Ast.module_name; func_name; func_params; func_result} = i.it in | ||
let match_import m i = | ||
let {module_name; func_name; itype} = i.it in | ||
let {ins; out} = List.nth m.it.types itype.it in | ||
if module_name <> "stdio" then | ||
Error.error i.at ("no builtin module \"" ^ module_name ^ "\""); | ||
match func_name with | ||
| "print" -> | ||
if func_result <> None then | ||
if out <> None then | ||
Error.error i.at "stdio.print has no result"; | ||
| _ -> | ||
Error.error i.at ("no \"stdio." ^ func_name ^ "\"") | ||
|
||
let match_imports (is : Ast.import list) = | ||
List.map match_import is | ||
let match_imports m = | ||
List.map (match_import m) m.it.imports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
val match_imports : Ast.import list -> Eval.import list | ||
val match_imports : Ast.module_ -> Eval.import list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.