@ -45,7 +45,7 @@ var specialVariables = {
// usage of now special variable
// usage of now special variable
function isNowAccess ( node ) {
function isNowAccess ( node ) {
return nodeType ( node , nodeTypes . IDENTIFIER ) &&
return nodeType ( node , nodeTypes . IDENTIFIER ) &&
retur nType( node , basicTypes . UINT ) &&
expressio nType( node , basicTypes . UINT ) &&
name ( node , 'now' )
name ( node , 'now' )
}
}
@ -93,20 +93,20 @@ function isLLDelegatecall (node) {
undefined , basicTypes . ADDRESS , lowLevelCallTypes . DELEGATECALL . ident )
undefined , basicTypes . ADDRESS , lowLevelCallTypes . DELEGATECALL . ident )
}
}
function isMemberAccess ( node , retType , accesser , accesse rType , memberName ) {
function isMemberAccess ( node , retType , accessor , accesso rType , memberName ) {
return nodeType ( node , nodeTypes . MEMBERACCESS ) &&
return nodeType ( node , nodeTypes . MEMBERACCESS ) &&
retur nType( node , retType ) &&
expressio nType( node , retType ) &&
name ( node , memberName ) &&
name ( node , memberName ) &&
nrOfChildren ( node , 1 ) &&
nrOfChildren ( node , 1 ) &&
name ( node . children [ 0 ] , accesse r ) &&
name ( node . children [ 0 ] , accesso r ) &&
retur nType( node . children [ 0 ] , accesse rType )
expressio nType( node . children [ 0 ] , accesso rType )
}
}
function nrOfChildren ( node , nr ) {
function nrOfChildren ( node , nr ) {
return ( node && ( nr === undefined || nr === null ) ) || ( node && node . children && node . children . length === nr )
return ( node && ( nr === undefined || nr === null ) ) || ( node && node . children && node . children . length === nr )
}
}
function retur nType ( node , typeRegex ) {
function expressio nType ( node , typeRegex ) {
return ( node && ! typeRegex ) || ( node && node . attributes && new RegExp ( typeRegex ) . test ( node . attributes . type ) )
return ( node && ! typeRegex ) || ( node && node . attributes && new RegExp ( typeRegex ) . test ( node . attributes . type ) )
}
}
@ -148,7 +148,7 @@ module.exports = {
specialVariables : specialVariables ,
specialVariables : specialVariables ,
helpers : {
helpers : {
nrOfChildren : nrOfChildren ,
nrOfChildren : nrOfChildren ,
returnType : retur nType,
expressionType : expressio nType,
nodeType : nodeType ,
nodeType : nodeType ,
name : name ,
name : name ,
buildFunctionSignature : buildFunctionSignature
buildFunctionSignature : buildFunctionSignature