info, "flag '%s' may only use true value" % key)
-def normalize_if(expr):
- ifcond = expr.get('if')
- if isinstance(ifcond, str):
- expr['if'] = [ifcond]
-
-
def check_if(expr, info, source):
def check_if_str(ifcond, info):
check_if_str(elt, info)
else:
check_if_str(ifcond, info)
+ expr['if'] = [ifcond]
def normalize_members(members):
raise QAPISemError(info, "%s uses reserved name" % key_source)
check_keys(arg, info, key_source, ['type'], ['if'])
check_if(arg, info, key_source)
- normalize_if(arg)
check_type(arg['type'], info, key_source, allow_array=True)
source = "%s '%s'" % (source, f['name'])
check_name_str(f['name'], info, source)
check_if(f, info, source)
- normalize_if(f)
def normalize_enum(expr):
check_name_str(member['name'], info, source,
enum_member=True, permit_upper=permit_upper)
check_if(member, info, source)
- normalize_if(member)
def check_struct(expr, info):
check_name_str(key, info, source)
check_keys(value, info, source, ['type'], ['if'])
check_if(value, info, source)
- normalize_if(value)
check_type(value['type'], info, source, allow_array=not base)
check_name_str(key, info, source)
check_keys(value, info, source, ['type'], ['if'])
check_if(value, info, source)
- normalize_if(value)
check_type(value['type'], info, source)
else:
assert False, 'unexpected meta type'
- normalize_if(expr)
check_if(expr, info, meta)
check_flags(expr, info)