YAML scanner and parser extracted from goyaml (C port).