More infrastructure.

Improve handling of memory.grow/size, add a standalone wast runner,
test harness improvements.
This commit is contained in:
Dan Gohman
2018-12-03 04:59:40 -08:00
parent 83f8a31010
commit 7faa15d7ac
15 changed files with 316 additions and 82 deletions

View File

@@ -29,10 +29,14 @@ fn main() {
writeln!(
out,
"fn {}() {{",
path.file_stem()
.expect("file_stem")
.to_str()
.expect("to_str")
avoid_keywords(
&path
.file_stem()
.expect("file_stem")
.to_str()
.expect("to_str")
.replace("-", "_")
)
);
writeln!(
out,
@@ -44,3 +48,14 @@ fn main() {
writeln!(out);
}
}
fn avoid_keywords(name: &str) -> &str {
match name {
"if" => "if_",
"loop" => "loop_",
"type" => "type_",
"const" => "const_",
"return" => "return_",
other => other,
}
}