Skip to content

Commit ce56cb3

Browse files
committed
Split up WHITESPACE
I'm splitting out `HORIZONTAL_WHITESPACE` to make it easier to connect the concept in frontmatter with `WHITESPACE`. In doing this, I found it awkward to only pull out part when the comments are there. I either needed a redundant comment to start a section, re-arrange out of order from Unicode, or split out all classes. I did the latter.
1 parent 866d324 commit ce56cb3

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

src/whitespace.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,32 @@ r[lex.whitespace]
44
r[whitespace.syntax]
55
```grammar,lexer
66
@root WHITESPACE ->
7-
// end of line
8-
LF
7+
END_OF_LINE
8+
| IGNORABLE_CODE_POINT
9+
| HORIZONTAL_WHITESPACE
10+
11+
END_OF_LINE ->
12+
U+000A // line feed, `'\n'`
913
| U+000B // vertical tabulation
1014
| U+000C // form feed
11-
| CR
12-
| U+0085 // Unicode next line
13-
| U+2028 // Unicode LINE SEPARATOR
14-
| U+2029 // Unicode PARAGRAPH SEPARATOR
15-
// Ignorable Code Point
16-
| U+200E // Unicode LEFT-TO-RIGHT MARK
17-
| U+200F // Unicode RIGHT-TO-LEFT MARK
18-
// horizontal whitespace
19-
| TAB
20-
| U+0020 // space ' '
21-
22-
TAB -> U+0009 // horizontal tab ('\t')
23-
24-
LF -> U+000A // line feed ('\n')
25-
26-
CR -> U+000D // carriage return ('\r')
15+
| U+000D // carriage return, `'\r'`
16+
| U+0085 // next line
17+
| U+2028 // LINE SEPARATOR
18+
| U+2029 // PARAGRAPH SEPARATOR
19+
20+
IGNORABLE_CODE_POINT ->
21+
U+200E // LEFT-TO-RIGHT MARK
22+
| U+200F // RIGHT-TO-LEFT MARK
23+
24+
HORIZONTAL_WHITESPACE ->
25+
U+0009 // horizontal tab, `'\t'`
26+
| U+0020 // space, `' '`
27+
28+
TAB -> U+0009 // horizontal tab, `'\t'`
29+
30+
LF -> U+000A // line feed, `'\n'`
31+
32+
CR -> U+000D // carriage return, `'\r'`
2733
```
2834

2935
r[lex.whitespace.intro]

0 commit comments

Comments
 (0)