more restrictive regex

pull/7/head
yann300 8 years ago
parent 10b5308eb6
commit 0524a7d703
  1. 2
      src/solidity/decodeInfo.js

@ -160,7 +160,7 @@ function enumType (type, stateDefinitions, contractName) {
* @return {Object} returns decoded info about the current type: { storageBytes, typeName, members} * @return {Object} returns decoded info about the current type: { storageBytes, typeName, members}
*/ */
function struct (type, stateDefinitions, contractName) { function struct (type, stateDefinitions, contractName) {
var match = type.match(/struct (.*?)( storage ref| storage pointer| memory| calldata)?$/) var match = type.match(/struct (\S*?)( storage ref| storage pointer| memory| calldata)?$/)
if (match && match.length > 2) { if (match && match.length > 2) {
var memberDetails = getStructMembers(match[1], stateDefinitions, contractName) // type is used to extract the ast struct definition var memberDetails = getStructMembers(match[1], stateDefinitions, contractName) // type is used to extract the ast struct definition
if (!memberDetails) return null if (!memberDetails) return null

Loading…
Cancel
Save