LineParser
public sealed class LineParser : IDisposableInherits from System.Object
Implements System.IDisposable
#Nested Types
- MarkupDiagnostic structRepresents a diagnostic message produced during markup parsing.
#Fields
#CharacterAttribute
character attribute.public const string CharacterAttribute = "character";Type String
See also
#CharacterAttributeNameProperty
character attribute.public const string CharacterAttributeNameProperty = "name";Type String
See also
#NoMarkupAttribute
public const string NoMarkupAttribute = "nomarkup";Type String
#ReplacementMarkerContents
public const string ReplacementMarkerContents = "contents";Type String
#TrimWhitespaceProperty
public const string TrimWhitespaceProperty = "trimwhitespace";Type String
#Methods
#DeregisterMarkerProcessor(string)
public void DeregisterMarkerProcessor(string attributeName)Parameters
attributeNamestringThe name of the marker.
#Dispose()
public void Dispose()#ExpandSubstitutions(string, IList<string>)
public static string ExpandSubstitutions(string text, IList<string> substitutions)Parameters
textstringThe text containing substitution markers.substitutionsSystem.Collections.Generic.IList<string>The list of substitutions.
Returns String: text, with the content from substitutions inserted.
{0}
- with the corresponding entry in substitutions.
If text contains a substitution marker whose
index is not present in substitutions, it is
ignored.#ParseString(string, string, bool)
public MarkupParseResult ParseString(string input, string localeCode, bool addImplicitCharacterAttribute = true)Parameters
inputstringThe text to parse.localeCodestringThe locale to use when processing markers, as a BCP-47 locale tag.squish(unknown)Iffalse, markers that are split as part of the markup parsing process will not be re-merged before returning the result.sort(unknown)Iftrue, markers will be sorted based on their position in the input.åaddImplicitCharacterAttributeboolIf true, the parser will attempt to detect a character name in the text and add a[character]attribute for it.
Returns MarkupParseResult: A markup parse result.
#ParseStringAndIncludeMarkupDiagnostics(string, string, bool)
public (MarkupParseResult markup, List<MarkupDiagnostic> diagnostics) ParseStringAndIncludeMarkupDiagnostics(string input, string localeCode, bool addImplicitCharacterAttribute = true)Parameters
inputstringThe text to parse.localeCodestringThe locale to use when processing markers, as a BCP-47 locale tag.squish(unknown)Iffalse, markers that are split as part of the markup parsing process will not be re-merged before returning the result.sort(unknown)Iftrue, markers will be sorted based on their position in the input.åaddImplicitCharacterAttributeboolIf true, the parser will attempt to detect a character name in the text and add a[character]attribute for it.
Returns ValueTuple: A markup parse result and a collection of diagnostics encountered while parsing the markup.
#RegisterMarkerProcessor(string, IAttributeMarkerProcessor)
public void RegisterMarkerProcessor(string attributeName, IAttributeMarkerProcessor markerProcessor)Parameters
attributeNamestringThe name of the marker that should use this marker processor.markerProcessorYarn.Markup.IAttributeMarkerProcessorThe object that should be invoked when markers with this name are encountered.
nomarkup tag is
implemented in this way by the LineParser class
directly; the Dialogue class uses this mechanism
to implement the select, plural and ordinal markers.Generated from Yarn Spinner for Unity 3.3.