add using optional module name to registred names (#8)

This commit is contained in:
vms 2019-03-29 19:01:49 +03:00 committed by GitHub
parent 1323e02c95
commit 119ce58c9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -21,7 +21,7 @@ buildscript {
allprojects {
apply plugin: 'java'
group 'com.github.cretz.asmble'
version '0.4.2-fl'
version '0.4.4-fl'
// skips building and running for the specified examples
ext.skipExamples = ['c-simple', 'go-simple', 'rust-regex']

View File

@ -70,8 +70,10 @@ open class Translate : Command<Translate.Args>() {
}
}
"wasm" ->
Script(listOf(Script.Cmd.Module(BinaryToAst(logger = this.logger).toModule(
ByteReader.InputStream(inBytes.inputStream())), null)))
BinaryToAst(logger = this.logger).toModule(
ByteReader.InputStream(inBytes.inputStream())).let { module ->
Script(listOf(Script.Cmd.Module(module, module.names?.moduleName)))
}
else -> error("Unknown in format '$inFormat'")
}
}