Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Token('IDENT', 'Custom'),
]),
]),
]),
]),
]),
]),
]),
]),
]),
]),
]),
]),
]),
),
# Schema with invalid double ! modifier
(
Token('IDENT', 'Date'),
]),
]),
]),
]),
]),
]),
]),
]),
Tree('type_system_definition', [
Tree('type_extension', [
Tree('input_object_type_extension', [
Token('EXTEND', 'extend'),
Token('INPUT', 'input'),
Tree('name', [
Token('IDENT', 'FilterCharacters'),
]),
Tree('input_fields_definition', [
Tree('input_value_definition', [
Tree('name', [
Token('IDENT', 'existsSince'),
]),
Tree('type', [
Tree('named_type', [
Tree('name', [
Token('IDENT', 'Date'),
]),
]),
]),
]),
]),
]),
Token('IDENT', 'acl'),
]),
Tree('arguments', [
Tree('argument', [
Tree('name', [
Token('IDENT', 'role'),
]),
Tree('value', [
Tree('string_value', [
Token('STRING', '"can-filter"'),
]),
]),
]),
]),
]),
]),
Tree('input_fields_definition', [
def test_string_turns_list_into_empty_string(self):
h = HaxeTransformer()
metadata = '@:build(flixel.system.FlxAssets.buildFileReferences("assets", true))'
data = [Token("LONG_STRING", '"""{}"""'.format(metadata))]
output = h.string(data)
self.assertEqual("", output)
Token('IDENT', 'INACTIVE'),
]),
]),
]),
Tree('enum_value_definition', [
Tree('enum_value', [
Tree('name', [
Token('IDENT', 'SUSPENDED'),
]),
]),
]),
]),
]),
]),
]),
]),
),
Token('IDENT', 'str'),
]),
Tree('value', [
Tree('string_value', [
Token('STRING', '"test"')
]),
]),
]),
Tree('argument', [
Tree('name', [
Token('IDENT', 'int'),
]),
Tree('value', [
Tree('int_value', [
Token('SIGNED_INT', '14')
]),
]),
Token('IDENT', 'NOT_FOUND'),
]),
]),
]),
Tree('enum_value_definition', [
Tree('enum_value', [
Tree('name', [
Token('IDENT', 'ACTIVE'),
]),
]),
Tree('directives', [
Tree('directive', [
Tree('name', [
Token('IDENT', 'cache'),
]),
Tree('arguments', [
Tree('argument', [
def reduce_expr(self, tree):
lst = tree.children.copy()
for node in lst:
if not isinstance(node, Token):
self.visit(node)