File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 11import  struct  WasmParser. CustomSection
22import  struct  WasmParser. NameSectionParser
3+ import  struct  WasmParser. NameMap
34import  class  WasmParser. StaticByteStream
45
56struct  NameRegistry  { 
@@ -21,7 +22,7 @@ struct NameRegistry {
2122        } 
2223    } 
2324
24-     private  mutating  func  register( instance:  InternalInstance ,  nameMap:  NameSectionParser . NameMap )  { 
25+     private  mutating  func  register( instance:  InternalInstance ,  nameMap:  NameMap )  { 
2526        for  (index,  name)    in  nameMap { 
2627            let  addr  =  instance. functions [ Int ( index) ] 
2728            self . functionNames [ addr]  =  name
Original file line number Diff line number Diff line change @@ -1174,21 +1174,21 @@ extension Parser {
11741174    } 
11751175} 
11761176
1177+ /// A map of names by its index.
1178+ public  typealias  NameMap  =  [ UInt32 :  String ] 
1179+ 
1180+ /// Parsed names.
1181+ public  enum  ParsedNames  { 
1182+     /// Function names.
1183+     case  functions( NameMap ) 
1184+ } 
1185+ 
11771186/// A parser for the name custom section.
11781187///
11791188/// > Note: <https://webassembly.github.io/spec/core/appendix/custom.html#name-section>
11801189public  struct  NameSectionParser < Stream:  ByteStream >  { 
11811190    let  stream :  Stream 
11821191
1183-     /// A map of names by its index.
1184-     public  typealias  NameMap  =  [ UInt32 :  String ] 
1185- 
1186-     /// Parsed names.
1187-     public  enum  ParsedNames  { 
1188-         /// Function names.
1189-         case  functions( NameMap ) 
1190-     } 
1191- 
11921192    public  init ( stream:  Stream )  { 
11931193        self . stream =  stream
11941194    } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments