remix-debug/src/solidity-decoder/decodeInfo.js
function parseType (type, stateDefinitions, contractName, location) {
  var decodeInfos = {
    'contract': address,
    'address': address,
    'array': array,
    'bool': bool,
    'bytes': dynamicByteArray,
    'bytesX': fixedByteArray,
    'enum': enumType,
    'string': stringType,
    'struct': struct,
    'int': int,
    'uint': uint,
    'mapping': mapping
  }
  var currentType = typeClass(type)
  if (currentType === null) {
    console.log('unable to retrieve decode info of ' + type)
    return null
  }
  if (decodeInfos[currentType]) {
    return decodeInfos[currentType](type, stateDefinitions, contractName, location)
  } else {
    return null
  }
}
function parseType (type, stateDefinitions, contractName, location) {
  var decodeInfos = {
    'contract': address,
    'address': address,
    'array': array,
    'bool': bool,
    'bytes': dynamicByteArray,
    'bytesX': fixedByteArray,
    'enum': enumType,
    'string': stringType,
    'struct': struct,
    'int': int,
    'uint': uint,
    'mapping': mapping
  }
  var currentType = typeClass(type)
  if (currentType === null) {
    console.log('unable to retrieve decode info of ' + type)
    return null
  }
  if (decodeInfos[currentType]) {
    return decodeInfos[currentType](type, stateDefinitions, contractName, location)
  } else {
    return null
  }
}
function parseType ( type , stateDefinitions , contractName , location ) { var decodeInfos = { 'contract' : address , 'address' : address , 'array' : array , 'bool' : bool , 'bytes' : dynamicByteArray , 'bytesX' : fixedByteArray , 'enum' : enumType , 'string' : stringType , 'struct' : struct , 'int' : int , 'uint' : uint , 'mapping' : mapping } var currentType = typeClass ( type ) if ( currentType === null ) { console . log ( 'unable to retrieve decode info of ' + type ) return null } if ( decodeInfos [ currentType ] ) { return decodeInfos [ currentType ] ( type , stateDefinitions , contractName , location ) } else { return null } }
parse the type and return an object representing the type

@param {Object} type - type name given by the ast node
@param {Object} stateDefinitions - all state stateDefinitions given by the AST (including struct and enum type declaration) for all contracts
@param {String} contractName - contract the @args typeName belongs to
@param {String} location - location of the data (storage ref| storage pointer| memory| calldata)
@return {Object} - return the corresponding decoder or null on error
parse the type and return an object representing the type