summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2003-07-17 16:12:45 +0000
committerburaq <buraq@epfl.ch>2003-07-17 16:12:45 +0000
commit0715852a2ecbe5bc8b0bf03b13a24a79d1e7105a (patch)
tree9100c00b0aee45386b0351bc738ddcc0d21a0816 /doc
parent14143d5b3e13e0341d2447c9ccea591cdcb2e4c4 (diff)
downloadscala-0715852a2ecbe5bc8b0bf03b13a24a79d1e7105a.tar.gz
scala-0715852a2ecbe5bc8b0bf03b13a24a79d1e7105a.tar.bz2
scala-0715852a2ecbe5bc8b0bf03b13a24a79d1e7105a.zip
rules for Pattern in grammar in appendix
Diffstat (limited to 'doc')
-rw-r--r--doc/reference/reference.verb.tex38
1 files changed, 17 insertions, 21 deletions
diff --git a/doc/reference/reference.verb.tex b/doc/reference/reference.verb.tex
index 54bcf8b8af..0455421fe5 100644
--- a/doc/reference/reference.verb.tex
+++ b/doc/reference/reference.verb.tex
@@ -189,6 +189,8 @@ inherited abstract members.
translated to method calls of their operand.
}
+% 16 Jul 2003 Regular pattern matching (Chapter 8)
+
\subsection*{Status of This Document}
The present document defines slightly more than what is implemented in
@@ -3066,18 +3068,6 @@ SimplePattern \=::= \> varid [ '@' SimplePattern ]
Patterns \>::= \> Pattern {`,' Pattern}
\end{verbatim}
-%% \syntax\begin{verbatim}
-%% Pattern \=::= \= SimplePattern {Id SimplePattern}
-%% \> | \> varid `:' Type
-%% \> | \> `_' `:' Type
-%% SimplePattern \>::= \> varid
-%% \> | \> `_'
-%% \> | \> literal
-%% \> | \> StableId {`(' [Patterns] `)'}
-%% \> | \> `(' [Patterns] `)'
-%% \> | \> `[' [Patterns] `]'
-%% Patterns \>::= \> Pattern {`,' Pattern}
-%% \end{verbatim}
A pattern is built from constants, constructors, variables and regular
operators. Pattern matching tests whether a given value (sequence
@@ -4272,15 +4262,21 @@ grammar.
Constr \>::=\> StableId [TypeArgs] [`(' [Exprs] `)']
- Pattern \>::=\> varid `:' Type1
- \> |\> `_' `:' Type1
- \> |\> SimplePattern {Id SimplePattern}
- SimplePattern \>::=\> varid
- \> |\> `_'
- \> |\> literal
- \> |\> StableId [`(' [Patterns] `)']
- \> |\> `(' [Pattern] `)'
- Patterns \>::=\> Pattern {`,' Pattern}
+ Pattern \>::= \= TreePattern { `|' TreePattern }
+
+ TreePattern \>::= \> varid `:' Type
+ \> | \> `_' `:' Type
+ \> | \> SimplePattern [ '*' | '?' | '+' ]
+ \> | \> SimplePattern { Id SimplePattern }
+
+ SimplePattern \>::= \> varid [ '@' SimplePattern ]
+ \> | \> `_'
+ \> | \> literal
+ \> | \> StableId [ `(' [Patterns] `)' ]
+ \> | \> `(' Patterns `)'
+ \> | \>
+
+ Patterns \>::= \> Pattern {`,' Pattern}
TypeParamClause \>::=\> `[' TypeParam {`,' TypeParam} `]'
FunTypeParamClause \>::=\> `[' TypeDcl {`,' TypeDcl} `]'