@@ -314,7 +314,7 @@ enum WasmGen {
314314        return  code
315315    } 
316316
317-     static  func  generateTextParser ( _ instructions:  InstructionSet )  ->  String  { 
317+     static  func  generateTextInstructionParser ( _ instructions:  InstructionSet )  ->  String  { 
318318        var  code  =  """ 
319319            import WasmParser 
320320            import WasmTypes 
@@ -399,13 +399,14 @@ enum WasmGen {
399399        return  code
400400    } 
401401
402-     static  func  generateInstructionEncoder ( _ instructions:  InstructionSet )  ->  String  { 
402+     static  func  generateBinaryInstructionEncoder ( _ instructions:  InstructionSet )  ->  String  { 
403403        var  code  =  """ 
404404            import WasmParser 
405405            import WasmTypes 
406406
407-             /// An instruction encoder that is responsible for encoding opcodes and immediates. 
408-             protocol InstructionEncoder: InstructionVisitor { 
407+             /// An instruction encoder that is responsible for encoding opcodes and immediates 
408+             /// in Wasm binary format. 
409+             protocol BinaryInstructionEncoder: InstructionVisitor { 
409410                /// Encodes an instruction opcode. 
410411                mutating func encodeInstruction(_ opcode: UInt8, _ prefix: UInt8?) throws 
411412
@@ -443,8 +444,8 @@ enum WasmGen {
443444        code +=  """ 
444445            } 
445446
446-             // InstructionEncoder  implements the InstructionVisitor protocol to call the corresponding encode method. 
447-             extension InstructionEncoder  { 
447+             // BinaryInstructionEncoder  implements the InstructionVisitor protocol to call the corresponding encode method. 
448+             extension BinaryInstructionEncoder  { 
448449
449450             """ 
450451
@@ -613,12 +614,12 @@ enum WasmGen {
613614                    +  " \n " 
614615            ) , 
615616            GeneratedFile ( 
616-                 projectSources +  [ " WAT " ,  " ParseInstruction .swift" ] , 
617-                 header +  generateTextParser ( instructions) 
617+                 projectSources +  [ " WAT " ,  " ParseTextInstruction .swift" ] , 
618+                 header +  generateTextInstructionParser ( instructions) 
618619            ) , 
619620            GeneratedFile ( 
620-                 projectSources +  [ " WAT " ,  " InstructionEncoder .swift" ] , 
621-                 header +  generateInstructionEncoder ( instructions) 
621+                 projectSources +  [ " WAT " ,  " BinaryInstructionEncoder .swift" ] , 
622+                 header +  generateBinaryInstructionEncoder ( instructions) 
622623            ) , 
623624        ] 
624625
0 commit comments