Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def check_support(self, feature, report=True):
if feature not in self.lang_features and report:
click.secho('Unsuported language feature: {}'.format(EFeature.IMPORT), fg='red')
return False
return True
EXTEND_INTERFACE = 'extend_interface'
IMPORT = 'import'
MAPS = 'maps'
DEFAULT_VALUES = 'default_values'
class EProfile(Enum):
MICRO = 'micro'
ADVANCED = 'advanced'
FULL = 'full'
_profiles = {
EProfile.MICRO: set(),
EProfile.ADVANCED: set([
EFeature.EXTEND_INTERFACE,
EFeature.IMPORT,
EFeature.MAPS,
EFeature.DEFAULT_VALUES
]),
EProfile.FULL: set(EFeature)
}
def get_features(name):
return _profiles.get(name, set())
class EProfile(Enum):
MICRO = 'micro'
ADVANCED = 'advanced'
FULL = 'full'
_profiles = {
EProfile.MICRO: set(),
EProfile.ADVANCED: set([
EFeature.EXTEND_INTERFACE,
EFeature.IMPORT,
EFeature.MAPS,
EFeature.DEFAULT_VALUES
]),
EProfile.FULL: set(EFeature)
}
def get_features(name):
return _profiles.get(name, set())
IMPORT = 'import'
MAPS = 'maps'
DEFAULT_VALUES = 'default_values'
class EProfile(Enum):
MICRO = 'micro'
ADVANCED = 'advanced'
FULL = 'full'
_profiles = {
EProfile.MICRO: set(),
EProfile.ADVANCED: set([
EFeature.EXTEND_INTERFACE,
EFeature.IMPORT,
EFeature.MAPS,
EFeature.DEFAULT_VALUES
]),
EProfile.FULL: set(EFeature)
}
def get_features(name):
return _profiles.get(name, set())
DEFAULT_VALUES = 'default_values'
class EProfile(Enum):
MICRO = 'micro'
ADVANCED = 'advanced'
FULL = 'full'
_profiles = {
EProfile.MICRO: set(),
EProfile.ADVANCED: set([
EFeature.EXTEND_INTERFACE,
EFeature.IMPORT,
EFeature.MAPS,
EFeature.DEFAULT_VALUES
]),
EProfile.FULL: set(EFeature)
}
def get_features(name):
return _profiles.get(name, set())
MAPS = 'maps'
DEFAULT_VALUES = 'default_values'
class EProfile(Enum):
MICRO = 'micro'
ADVANCED = 'advanced'
FULL = 'full'
_profiles = {
EProfile.MICRO: set(),
EProfile.ADVANCED: set([
EFeature.EXTEND_INTERFACE,
EFeature.IMPORT,
EFeature.MAPS,
EFeature.DEFAULT_VALUES
]),
EProfile.FULL: set(EFeature)
}
def get_features(name):
return _profiles.get(name, set())
type.is_primitive = True
type.name = ctxSymbol.name.text
elif ctx.typeSymbol().complexTypeSymbol():
# type:TParser.ComplexTypeSymbolContext
ctxSymbol = ctx.typeSymbol().complexTypeSymbol()
type.is_complex = True
type.name = ctxSymbol.name.text
elif ctx.typeSymbol().listTypeSymbol():
# type:TParser.ListTypeSymbolContext
ctxSymbol = ctx.typeSymbol().listTypeSymbol()
type.is_list = True
type.name = 'list'
type.nested = TypeSymbol("", type)
self.parse_type(ctxSymbol, type.nested)
elif ctx.typeSymbol().mapTypeSymbol():
self.check_support(EFeature.MAPS)
# type:TParser.ListTypeSymbolContext
ctxSymbol = ctx.typeSymbol().mapTypeSymbol()
type.is_map = True
type.name = 'map'
type.nested = TypeSymbol("", type)
self.parse_type(ctxSymbol, type.nested)
elif ctx.typeSymbol().modelTypeSymbol():
# type:TParser.ModelTypeSymbolContext
ctxSymbol = ctx.typeSymbol().modelTypeSymbol()
type.is_model = True
type.name = 'model'
type.nested = TypeSymbol("", type)
self.parse_type(ctxSymbol, type.nested)
if not type.module.checkType(type):
log.warn('Unknown type: {0}. Missing import?'.format(type.name))