Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

YarnCommandParser

Parses Yarn command strings with support for quoted arguments and escapes.
class_name YarnCommandParser
extends RefCounted

Inherits from RefCounted

#Methods

#get_args(String)

static func get_args(command_text: String) -> Array[String]

Parameters

  • command_textString

Returns Array[String]

#get_command_name(String)

static func get_command_name(command_text: String) -> String

Parameters

  • command_textString

Returns String

#parse_to_dict(String)

Returns {"name": "command_name", "args": ["arg1", "arg2"]}.
static func parse_to_dict(command_text: String) -> Dictionary

Parameters

  • command_textString

Returns Dictionary

#parse(String)

Returns [command_name, arg1, arg2, ...]. Splits on whitespace outside quotes. Only double quotes delimit a quoted span; inside one, \\ and \" are the only escapes, and closing the quote flushes the token immediately even if more non-whitespace text follows (so text before a quote merges with it, but text after does not). Single quotes and backslashes outside quotes carry no special meaning.
static func parse(command_text: String) -> Array[String]

Parameters

  • command_textString

Returns Array[String]

Generated from Yarn Spinner for Godot GDScript 3.3.