Closed He-Pin closed 2 weeks ago
function-name = function-name-first *function-name-char function-name-first = LCALPHA function-name-char = function-name-first / "_" / DIGIT LCALPHA = %x61-7A ; "a".."z" function-expr = function-name "(" S [function-argument *(S "," S function-argument)] S ")"
https://www.rfc-editor.org/rfc/rfc9535#name-collected-abnf-grammars
private def isFunctionNameAcceptable(c: Char): Boolean = { println("testing: " + c) 'a' <= c && c <= 'z' } private def `function-name-first`[_: P]: P[Unit] = P(CharsWhile(isFunctionNameAcceptable, 1)) private def isFunctionNameCharAcceptable(c: Char): Boolean = isFunctionNameAcceptable(c) || c == '_' || c.isDigit private def `function-name`[_: P]: P[String] = P(`function-name-first` ~~ `function-name-char`.rep).!
Which will print:
testing: ( testing: ( testing: ( testing: ( testing: ( testing: ( ...
I will change to use CharIn and CharsWhileIn
CharIn
CharsWhileIn
Can you minimize the issue and open a discussion? I both don't have enough and have too much code here to see what's wrong, and it's very likely user error.
https://www.rfc-editor.org/rfc/rfc9535#name-collected-abnf-grammars
Which will print:
I will change to use
CharIn
andCharsWhileIn