parser property

Parser<TomlSinglelineString> parser
final

Parser for a singleline TOML string value.

Even though "" and '' are valid single line strings, this parser does not accept them if the input starts with """ or '''. Without this optimization TomlString.parser would always accept multiline strings that contain syntax errors and the unconsumed quotation mark would cause a less descriptive error message later.

Implementation

static final Parser<TomlSinglelineString> parser = ChoiceParser([
  TomlBasicString.parser
      .skip(before: string(TomlMultilineBasicString.delimiter).not()),
  TomlLiteralString.parser
      .skip(before: string(TomlMultilineLiteralString.delimiter).not()),
], failureJoiner: selectFarthestJoined);