[Wasm] Don't print "field" for array types in wat
This commit is contained in:
committed by
Space Team
parent
8d440a61e2
commit
8a9531ce3c
@@ -306,7 +306,7 @@ class WasmIrToText : SExpressionBuilder() {
|
|||||||
newLineList("type") {
|
newLineList("type") {
|
||||||
appendModuleFieldReference(type)
|
appendModuleFieldReference(type)
|
||||||
sameLineList("array") {
|
sameLineList("array") {
|
||||||
appendStructField(type.field)
|
appendFieldType(type.field)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -511,11 +511,15 @@ class WasmIrToText : SExpressionBuilder() {
|
|||||||
|
|
||||||
private fun appendStructField(field: WasmStructFieldDeclaration) {
|
private fun appendStructField(field: WasmStructFieldDeclaration) {
|
||||||
sameLineList("field") {
|
sameLineList("field") {
|
||||||
if (field.isMutable) {
|
appendFieldType(field)
|
||||||
sameLineList("mut") { appendType(field.type) }
|
}
|
||||||
} else {
|
}
|
||||||
appendType(field.type)
|
|
||||||
}
|
private fun appendFieldType(field: WasmStructFieldDeclaration) {
|
||||||
|
if (field.isMutable) {
|
||||||
|
sameLineList("mut") { appendType(field.type) }
|
||||||
|
} else {
|
||||||
|
appendType(field.type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user