parameters: (ctxt, node)
docstring: Parse a struct field's type.
  
      Can be a scalar like "string", or a mapping like {variant: ["string", "int"]}.
docstring_summary: Parse a struct field's type.
docstring_tokens: Parse a struct field s type .
function: def _parse_field_type(ctxt, node):
      # type: (errors.ParserContext, yaml.nodes.MappingNode) -> syntax.FieldType
      """Parse a struct field's type.
  
      Can be a scalar like "string", or a mapping like {variant: ["string", "int"]}.
      """
      if node.id == "mapping":
          # For now, FieldTypeVariant is the only non-scalar node.
          variant = syntax.FieldTypeVariant(ctxt.file_name, node.start_mark.line,
                                            node.start_mark.column)
          _generic_parser(
              ctxt, node, "type", variant,
              {"variant": _RuleDesc("sequence", sequence_parser_func=_parse_variant_alternatives)})
          return variant
      else:
          assert node.id == "scalar"
          single = syntax.FieldTypeSingle(ctxt.file_name, node.start_mark.line,
                                          node.start_mark.column)
  
          if node.value.startswith('array<'):
              single.type_name = syntax.parse_array_type(node.value)
              return syntax.FieldTypeArray(single)
  
          single.type_name = node.value
          return single
function_tokens: def _parse_field_type ( ctxt , node ) : # type: (errors.ParserContext, yaml.nodes.MappingNode) -> syntax.FieldType if node . id == "mapping" : # For now, FieldTypeVariant is the only non-scalar node. variant = syntax . FieldTypeVariant ( ctxt . file_name , node . start_mark . line , node . start_mark . column ) _generic_parser ( ctxt , node , "type" , variant , { "variant" : _RuleDesc ( "sequence" , sequence_parser_func = _parse_variant_alternatives ) } ) return variant else : assert node . id == "scalar" single = syntax . FieldTypeSingle ( ctxt . file_name , node . start_mark . line , node . start_mark . column ) if node . value . startswith ( 'array<' ) : single . type_name = syntax . parse_array_type ( node . value ) return syntax . FieldTypeArray ( single ) single . type_name = node . value return single