Skip to content

Instantly share code, notes, and snippets.

@eliperkins
Created May 19, 2015 15:02
Show Gist options
  • Save eliperkins/afb86d4a282ea67feb45 to your computer and use it in GitHub Desktop.
Save eliperkins/afb86d4a282ea67feb45 to your computer and use it in GitHub Desktop.
/** The token structure. */
typedef struct yaml_token_s {
/** The token type. */
yaml_token_type_t type;
/** The token data. */
union {
/** The stream start (for @c YAML_STREAM_START_TOKEN). */
struct {
/** The stream encoding. */
yaml_encoding_t encoding;
} stream_start;
/** The alias (for @c YAML_ALIAS_TOKEN). */
struct {
/** The alias value. */
yaml_char_t *value;
} alias;
/** The anchor (for @c YAML_ANCHOR_TOKEN). */
struct {
/** The anchor value. */
yaml_char_t *value;
} anchor;
/** The tag (for @c YAML_TAG_TOKEN). */
struct {
/** The tag handle. */
yaml_char_t *handle;
/** The tag suffix. */
yaml_char_t *suffix;
} tag;
/** The scalar value (for @c YAML_SCALAR_TOKEN). */
struct {
/** The scalar value. */
yaml_char_t *value;
/** The length of the scalar value. */
size_t length;
/** The scalar style. */
yaml_scalar_style_t style;
} scalar;
/** The version directive (for @c YAML_VERSION_DIRECTIVE_TOKEN). */
struct {
/** The major version number. */
int major;
/** The minor version number. */
int minor;
} version_directive;
/** The tag directive (for @c YAML_TAG_DIRECTIVE_TOKEN). */
struct {
/** The tag handle. */
yaml_char_t *handle;
/** The tag prefix. */
yaml_char_t *prefix;
} tag_directive;
} data;
/** The beginning of the token. */
yaml_mark_t start_mark;
/** The end of the token. */
yaml_mark_t end_mark;
} yaml_token_t;
/** The token structure. */
struct yaml_token_s {
/** The token type. */
var type: yaml_token_type_t
/** The token data. */
/** The stream start (for @c YAML_STREAM_START_TOKEN). */
/** The stream encoding. */
/** The alias (for @c YAML_ALIAS_TOKEN). */
/** The alias value. */
/** The anchor (for @c YAML_ANCHOR_TOKEN). */
/** The anchor value. */
/** The tag (for @c YAML_TAG_TOKEN). */
/** The tag handle. */
/** The tag suffix. */
/** The scalar value (for @c YAML_SCALAR_TOKEN). */
/** The scalar value. */
/** The length of the scalar value. */
/** The scalar style. */
/** The version directive (for @c YAML_VERSION_DIRECTIVE_TOKEN). */
/** The major version number. */
/** The minor version number. */
/** The tag directive (for @c YAML_TAG_DIRECTIVE_TOKEN). */
/** The tag handle. */
/** The tag prefix. */
/** The beginning of the token. */
var start_mark: yaml_mark_t
/** The end of the token. */
var end_mark: yaml_mark_t
init()
}
typealias yaml_token_t = yaml_token_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment