Closed
Description
private def `name-first`[_: P]: P[Unit] = P(CharsWhile(isNameFirstAcceptable, 1))
private def `name-char`[_: P]: P[Unit] = P(CharsWhile(isNameCharAcceptable, 1))
/**
* https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1
*
* {{{
* member-name-shorthand = name-first *name-char
* name-first = ALPHA /
* "_" /
* %x80-D7FF /
* ; skip surrogate code points
* %xE000-10FFFF
* name-char = name-first / DIGIT
*
* DIGIT = %x30-39 ; 0-9
* ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
* }}}
* */
private def `member-name-shorthandIdentifier`[_: P]: P[String] = P(`name-first` ~ `name-char`.rep).!
Works well, but if I change the name-char
to 0
then it will never end, eg:
private def `name-char`[_: P]: P[Unit] = P(CharsWhile(isNameCharAcceptable, 0))

Metadata
Metadata
Assignees
Labels
No labels