@prefix.setter
def prefix(self, value):
- if not is_valid_identifier(value):
+ if not _is_valid_identifier(value):
raise ConfigError('prefix must be a valid C identifier')
self._prefix = value
])
-def is_valid_identifier(iden):
+def _is_valid_identifier(iden):
if not _re_iden.match(iden):
return False
raise ConfigError('invalid trace packet header type', e)
for stream_name, stream in meta.streams.items():
- if not is_valid_identifier(stream_name):
+ if not _is_valid_identifier(stream_name):
raise ConfigError('stream name "{}" is not a valid C identifier'.format(stream_name))
self._cur_entity = _Entity.STREAM_PACKET_CONTEXT
try:
for ev_name, ev in stream.events.items():
- if not is_valid_identifier(ev_name):
+ if not _is_valid_identifier(ev_name):
raise ConfigError('event name "{}" is not a valid C identifier'.format(ev_name))
self._cur_entity = _Entity.EVENT_CONTEXT
raise ConfigError('"fields" property of structure type object must be an associative array')
for field_name, field_node in fields.items():
- if not is_valid_identifier(field_name):
+ if not _is_valid_identifier(field_name):
raise ConfigError('"{}" is not a valid field name for structure type'.format(field_name))
try:
# do not validate type names for the moment; will be done in a
# second phase
for type_name, type_node in types.items():
- if not is_valid_identifier(type_name):
+ if not _is_valid_identifier(type_name):
raise ConfigError('"{}" is not a valid type name for variant type'.format(type_name))
try:
raise ConfigError('"clocks" property (metadata) must be an associative array')
for clock_name, clock_node in clocks_node.items():
- if not is_valid_identifier(clock_name):
+ if not _is_valid_identifier(clock_name):
raise ConfigError('invalid clock name: "{}"'.format(clock_name))
if clock_name in self._clocks:
if env_name in env:
raise ConfigError('duplicate environment variable "{}"'.format(env_name))
- if not is_valid_identifier(env_name):
+ if not _is_valid_identifier(env_name):
raise ConfigError('invalid environment variable name: "{}"'.format(env_name))
if not _is_int_prop(env_value) and not _is_str_prop(env_value):
if not _is_str_prop(prefix_node):
raise ConfigError('"prefix" property (configuration) must be a string')
- if not is_valid_identifier(prefix_node):
+ if not _is_valid_identifier(prefix_node):
raise ConfigError('"prefix" property (configuration) must be a valid C identifier')
return prefix_node