[gyb_syntax_support] Remove Python code specific to SwiftSyntaxBuilder

These functions/definitions have been migrated to the SwiftSyntax repository.
This commit is contained in:
Alex Hoppen
2022-01-05 19:33:41 +01:00
parent 68eb340a2b
commit f3f2370d90
3 changed files with 0 additions and 109 deletions

View File

@@ -38,27 +38,3 @@ def lowercase_first_word(name):
if word_index == 0:
return name
return name[:word_index].lower() + name[word_index:]
def syntax_buildable_child_type(type_name, syntax_kind, is_token,
is_optional=False):
if syntax_kind in SYNTAX_BASE_KINDS:
buildable_type = syntax_kind + 'Buildable'
elif not is_token:
buildable_type = syntax_kind
else:
buildable_type = type_name
if is_optional:
buildable_type += '?'
return buildable_type
def syntax_buildable_default_init_value(child, token):
if child.is_optional:
return " = nil"
elif token and token.text:
return " = TokenSyntax.`%s`" % lowercase_first_word(token.name)
else:
return ""