summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-03-15 13:24:55 -0700
committerSom Snytt <som.snytt@gmail.com>2016-05-20 16:38:04 -0700
commit1e565d879360709758950332c19a77fffee073d1 (patch)
tree8378eabb74d56ff5148a01141b8269785bd64848 /spec
parent2eb1cc2e3df1627cde35afa1237cb10f508fe2f2 (diff)
downloadscala-1e565d879360709758950332c19a77fffee073d1.tar.gz
scala-1e565d879360709758950332c19a77fffee073d1.tar.bz2
scala-1e565d879360709758950332c19a77fffee073d1.zip
SI-8044 Allow any id in explicit pattern binding
Allows arbitrary identifier in `X @ pat`, including non-varids. This goes to regularity. Users of this syntax are not likely to be confused by the "backquoted var id is stable" rule. Also for sequence pattern, `X @ _*`.
Diffstat (limited to 'spec')
-rw-r--r--spec/08-pattern-matching.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/08-pattern-matching.md b/spec/08-pattern-matching.md
index 6753fa3ec7..35eb97b948 100644
--- a/spec/08-pattern-matching.md
+++ b/spec/08-pattern-matching.md
@@ -13,7 +13,7 @@ chapter: 8
Pattern1 ::= boundvarid ‘:’ TypePat
| ‘_’ ‘:’ TypePat
| Pattern2
- Pattern2 ::= boundvarid [‘@’ Pattern3]
+ Pattern2 ::= id [‘@’ Pattern3]
| Pattern3
Pattern3 ::= SimplePattern
| SimplePattern {id [nl] SimplePattern}
@@ -22,7 +22,7 @@ chapter: 8
| Literal
| StableId
| StableId ‘(’ [Patterns] ‘)’
- | StableId ‘(’ [Patterns ‘,’] [varid ‘@’] ‘_’ ‘*’ ‘)’
+ | StableId ‘(’ [Patterns ‘,’] [id ‘@’] ‘_’ ‘*’ ‘)’
| ‘(’ [Patterns] ‘)’
| XmlPattern
Patterns ::= Pattern {‘,’ Patterns}