Skip to content

Commit

Permalink
Correct letter pattern
Browse files Browse the repository at this point in the history
This previously copied the values from the Graphviz DOT lexer. That didn't actually work, since those are expressed in octal, and also don't refer to Unicode code points. According to a comment in the lexer, Graphviz will accept ASCII letters, underscore, and all non-ASCII characters for its "LETTER" class. (Non-ASCII characters in this case starts at 0200 or 0x80, non-breaking space.)
  • Loading branch information
mdaines committed Aug 1, 2023
1 parent 39099f6 commit 3156202
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/lang-dot/src/dot.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ConcatString {
blockCommentRest { ![*] blockCommentRest | "*" blockCommentAfterStar }
blockCommentAfterStar { "/" | "*" blockCommentAfterStar | ![/*] blockCommentRest }

letter { $[A-Za-z_\u{200}-\u{377}] }
letter { $[A-Za-z_$\u{80}-\u{10ffff}] }

digit { $[0-9] }

Expand Down
21 changes: 21 additions & 0 deletions packages/lang-dot/test/graph.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,27 @@ Graph(Header(...), Body(
))


# Names

graph {
a
A_1
café

}

==>

Graph(Header(...), Body(
SimpleStatement(Node(Name(...))),
SimpleStatement(Node(Name(...))),
SimpleStatement(Node(Name(...))),
SimpleStatement(Node(Name(...))),
SimpleStatement(Node(Name(...)))
))


# Numbers

graph 123 {
Expand Down

0 comments on commit 3156202

Please sign in to comment.