Skip to content

Commit c78db99

Browse files
committed
Fixed Syntax Summary
Reflect the following modifications to match the behavior of the actual code. - Unicode_Sm and Unicode_So included in opchar - Enumerates the characters available in opchar - Fixed upper and lower descriptions - Removed \u007F from printableChar - Fixed an error in Unicode category names(Ml -> Lm) Also removed unnecessary comment outs. scala/bug#12260
1 parent 0bd34f8 commit c78db99

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

spec/01-lexical-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classes (Unicode general category given in parentheses):
1919

2020
1. Whitespace characters. `\u0020 | \u0009 | \u000D | \u000A`.
2121
1. Letters, which include lower case letters (`Ll`), upper case letters (`Lu`),
22-
title case letters (`Lt`), other letters (`Lo`), modifier letters (`Ml`),
22+
title case letters (`Lt`), other letters (`Lo`), modifier letters (`Lm`),
2323
letter numerals (`Nl`) and the two characters `\u0024 ‘$’` and `\u005F ‘_’`.
2424
1. Digits `‘0’ | … | ‘9’`.
2525
1. Parentheses `‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ `.

spec/13-syntax-summary.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,20 @@ The lexical syntax of Scala is given by the following grammar in EBNF form:
1414

1515
```ebnf
1616
whiteSpace ::= ‘\u0020’ | ‘\u0009’ | ‘\u000D’ | ‘\u000A’
17-
upper ::= ‘A’ | … | ‘Z’ | ‘$’ // and any character in Unicode category Lu, Lt or Nl, and any character in Lo and Ml that don't have contributory property Other_Lowercase
18-
lower ::= ‘a’ | … | ‘z’ | ‘_’ // and any character in Unicode category Ll, and and any character in Lo or Ml that has contributory property Other_Lowercase
17+
upper ::= ‘A’ | … | ‘Z’ | ‘$’ and any character in Unicode categories Lu, Lt or Nl,
18+
and any character in Unicode categories Lo and Lm that don't have
19+
contributory property Other_Lowercase
20+
lower ::= ‘a’ | … | ‘z’ | ‘_’ and any character in Unicode category Ll,
21+
and any character in Unicode categories Lo or Lm that has contributory
22+
property Other_Lowercase
1923
letter ::= upper | lower
2024
digit ::= ‘0’ | … | ‘9’
2125
paren ::= ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’
2226
delim ::= ‘`’ | ‘'’ | ‘"’ | ‘.’ | ‘;’ | ‘,’
23-
opchar ::= // printableChar not matched by (whiteSpace | upper | lower |
24-
// letter | digit | paren | delim | Unicode_Sm | Unicode_So)
25-
printableChar ::= // all characters in [\u0020, \u007F] inclusive
27+
opchar ::= ‘!’ | ‘#’ | ‘%’ | ‘&’ | ‘*’ | ‘+’ | ‘-’ | ‘/’ | ‘:’ |
28+
‘<’ | ‘=’ | ‘>’ | ‘?’ | ‘@’ | ‘\’ | ‘^’ | ‘|’ | ‘~’
29+
and any character in Unicode categories Sm or So
30+
printableChar ::= all characters in [\u0020, \u007E] inclusive
2631
UnicodeEscape ::= ‘\’ ‘u’ {‘u’} hexDigit hexDigit hexDigit hexDigit
2732
hexDigit ::= ‘0’ | … | ‘9’ | ‘A’ | … | ‘F’ | ‘a’ | … | ‘f’
2833
charEscapeSeq ::= ‘\’ (‘b’ | ‘t’ | ‘n’ | ‘f’ | ‘r’ | ‘"’ | ‘'’ | ‘\’)

0 commit comments

Comments
 (0)