parse

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package parse implements the lexical helpers the TOON decoder needs: unescaping quoted tokens, scanning for unquoted characters, and splitting delimiter-separated cell sequences.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexUnquoted

func IndexUnquoted(s string, target rune) int

IndexUnquoted reports the byte index of the first occurrence of target that lies outside a quoted region, or -1.

func IsQuotedToken

func IsQuotedToken(token string) bool

IsQuotedToken reports whether token starts with a double quote, which obliges it to be a complete quoted token.

func SplitDelimited

func SplitDelimited(segment string, delimiter rune) []string

SplitDelimited splits a cell sequence on delimiter, honouring quoted regions, preserving empty tokens, and trimming the surrounding U+0020 of each token. A sequence that trims to nothing yields zero cells.

func UnquoteString

func UnquoteString(token string) (string, error)

UnquoteString removes the surrounding quotes from token and resolves its escape sequences.

func ValidateQuotedToken

func ValidateQuotedToken(token string) error

ValidateQuotedToken checks that a quoted token's closing quote is its last character.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址