示例#1
0
        public void AddStateVarToDynamicType(string varName, ContractDefinition dynamicType, VariableDeclaration varDecl)
        {
            Debug.Assert(varDecl.StateVariable);

            if (!StateVarNameResolutionMap.ContainsKey(varName))
            {
                StateVarNameResolutionMap[varName] = new Dictionary <ContractDefinition, VariableDeclaration>();
            }

            // may potentially override the previous value due to inheritance
            StateVarNameResolutionMap[varName][dynamicType] = varDecl;
        }
示例#2
0
 public bool HasStateVarName(string varName)
 {
     return(StateVarNameResolutionMap.ContainsKey(varName));
 }
示例#3
0
 public bool HasStateVar(string varName, ContractDefinition dynamicType)
 {
     return(StateVarNameResolutionMap.ContainsKey(varName) &&
            StateVarNameResolutionMap[varName].ContainsKey(dynamicType));
 }