Module shorthand

Module shorthand 

Expand description

Canonical parser and data model for Document Character (Dc) shorthands.

Implements shorthand syntax according to README.shorthand.md:

  • Bare integer: short Dc (\d+)
  • u prefix: Unicode character, hexadecimal (u[0-9a-f]+)
  • f prefix: Format Dc (f\d+)
  • l prefix: Long Dc (l\d+)
  • L prefix: Local graph ID (L\d+)

Shorthand tokens are strictly case-sensitive. Valid shorthands match [flL]?\d+ or u[0-9a-f]+; non-matching strings are rejected.

Enums§

DcShorthand
Representation of a parsed Document Character (Dc) shorthand identifier.

Constants§

MAX_FORMAT_ID
Maximum valid short Format ID.
MAX_SHORT_DC
Maximum valid short Dc ID.

Functions§

is_valid_shorthand
Checks whether a string conforms to the shorthand format regex [flL]?\d+ or u[0-9a-f]+ and valid range boundaries.
parse_format_shorthand
Parses a format ID shorthand string, accepting either f<digits> or bare <digits>.
parse_unicode_shorthand
Parses a Unicode shorthand string (u[0-9a-f]+).