@@ -659,25 +659,28 @@ function getIdentifierStart(ch: number): Identifier | undefined {
659659}
660660
661661export function isIdentifierStart ( ch : number ) : boolean {
662- // TODO: Check Identifiers
662+ // Ref ID spec: https://www.graphviz.org/doc/info/lang.html
663663 return (
664664 ( ch >= characterCodes . A && ch <= characterCodes . Z ) ||
665665 ( ch >= characterCodes . a && ch <= characterCodes . z ) ||
666- ( ch >= characterCodes . _0 && ch <= characterCodes . _9 ) ||
666+ ( ch >= 0x80 && ch <= 0xff ) ||
667667 ch === characterCodes . _ ||
668- ch === characterCodes . lessThan ||
669- ch === characterCodes . doubleQuote
668+ ( ch >= characterCodes . _0 && ch <= characterCodes . _9 ) || // Numerals
669+ ch === characterCodes . minus ||
670+ ch === characterCodes . dot ||
671+ ch === characterCodes . doubleQuote ||
672+ ch === characterCodes . lessThan
670673 ) ;
671674}
672675
673676function isIdentifierPart ( ch : number ) : boolean {
677+ // Ref ID spec: https://www.graphviz.org/doc/info/lang.html
674678 return (
675679 ( ch >= characterCodes . A && ch <= characterCodes . Z ) ||
676680 ( ch >= characterCodes . a && ch <= characterCodes . z ) ||
677681 ( ch >= characterCodes . _0 && ch <= characterCodes . _9 ) ||
678- ch === characterCodes . $ ||
679682 ch === characterCodes . _ ||
680- ch > characterCodes . maxAsciiCharacter
683+ ( ch >= 0x80 && ch <= 0xff ) // Extended ASCII (\200-\377)
681684 ) ;
682685}
683686
0 commit comments