Expression

Expression Types. Each of these represents an expression encountered in a statement

Expression
Static Members
new Base()
new Variable()
new Function()
new AddAssignOperator()
new AssignOperator()
new AssignmentOperator()
new DivideAssignOperator()
new ModulusAssignOperator()
new MultiplyAssignOperator()
new SubtractAssignOperator()
new LeftRightOperator()
new RightOperator()
new AndOperator()
new EqualityOperator()
new GreaterThanOperator()
new GreaterThanOrEqualOperator()
new LessThanOperator()
new LessThanOrEqualOperator()
new NotOperator()
new NotEqualityOperator()
new OrOperator()
new XorOperator()
new AddOperator()
new DivideOperator()
new ModulusOperator()
new MultiplyOperator()
new NegativeOperator()
new SubtractOperator()
new BooleanValue()
new FloatValue()
new IntegerValue()
new NullValue()
new StringValue()

ParserConfig

parser configuration

new ParserConfig()
Static Members
preprocessOnly
preprocessDebug
dialogSegmentPerLine

characterSupport

Should the parser interpret a dialog segment text fragment ending with ":" as a character name. e.g. "character name: i speak the thing"

characterSupport

Parser

Instances of this class are used to parse one or more yarn documents

new Parser(config: ParserConfig)
Parameters
config (ParserConfig) the configuration for this parser
Instance Members
parse(yarnString, bodyOnly, fileID)
preprocessedData
nodeNames
nodeTags
nodeNamed(name)
nodesTagged(tag)
errors
warnings
functionNames
variableNames
reset()

Node

Represents a yarn node

new Node()
Properties
name (string) : The title of this node. Should be unique.
Instance Members
attributes
tags
statements
location
hasStatements

Location

Instances of this class detail where in a file statements, warnings or errors are. Line and column information should be integers. If start and end are null, this location is for a given file.

new Location()
Properties
fileID (string) : The ID of the file this location pertains to.
nodeName (string) : The name of the node this location pertains to (if available)
start (object) : The start of this location.
  • start.line number

    The line that this location starts on.

  • start.column number

    The column that this location starts on.

end (object) : The start of this location.
  • end.line number

    The line that this location ends on.

  • end.column number

    The column that this location ends on.

Instance Members
singleCharacter

ParserMessage

Instances of this class detail messages from the parser.

new ParserMessage(message: any, location: any)
Parameters
message (any)
location (any)
Properties
message (string) : The message
location (Location) : The location of the message

Statement

Statement Types. Each of these represents a command encountered in a node body (or as part of a nested statement)

Statement
Static Members
new Base()
new Blank()
new Command()
new Conditional()
new DialogueSegment()
new Evaluate()
new Function()
new Group()
new Hashtag()
new LineGroup()
new Option()
new OptionGroup()
new Shortcut()
new ShortcutGroup()
new Text()

returnOutput

returnOutput
Returns
boolean: if this evaluation should return the value for display