summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-10-30 14:59:42 +0000
committerMartin Odersky <odersky@gmail.com>2003-10-30 14:59:42 +0000
commitd23d0a9c737c6350b3f00a555a3ec61fff8d92dc (patch)
tree7c6a3649edf42fceb39087c97eeae9f760a8503f /doc
parent4764fc555502237fc7f423af4200520a975a69fd (diff)
downloadscala-d23d0a9c737c6350b3f00a555a3ec61fff8d92dc.tar.gz
scala-d23d0a9c737c6350b3f00a555a3ec61fff8d92dc.tar.bz2
scala-d23d0a9c737c6350b3f00a555a3ec61fff8d92dc.zip
*** empty log message ***
Diffstat (limited to 'doc')
-rw-r--r--doc/reference/ScalaReference.tex38
1 files changed, 18 insertions, 20 deletions
diff --git a/doc/reference/ScalaReference.tex b/doc/reference/ScalaReference.tex
index 63be10f36d..fa8045290b 100644
--- a/doc/reference/ScalaReference.tex
+++ b/doc/reference/ScalaReference.tex
@@ -166,11 +166,6 @@ floating point numbers (of types \code{Float} and \code{Double}), characters, an
strings. The syntax of these literals is in each case as in Java.
\syntax\begin{lstlisting}
-literal ::= intLit
- | floatLit
- | charLit
- | stringLit
- | symbolLit
intLit ::= $\mbox{\rm\em ``as in Java''}$
floatLit ::= $\mbox{\rm\em ``as in Java''}$
charLit ::= $\mbox{\rm\em ``as in Java''}$
@@ -2237,7 +2232,7 @@ module FileSystem with {
InfixExpr ::= PrefixExpr
| InfixExpr id InfixExpr
PrefixExpr ::= [`-' | `+' | `~' | `!'] SimpleExpr
- SimpleExpr ::= literal
+ SimpleExpr ::= Literal
| Path
| `(' [Expr] `)'
| BlockExpr
@@ -2265,12 +2260,15 @@ $T$.
\section{Literals}
\syntax\begin{lstlisting}
- SimpleExpr ::= literal
- literal ::= intLit
+ SimpleExpr ::= Literal
+ Literal ::= intLit
| floatLit
| charLit
| stringLit
| symbolLit
+ | true
+ | false
+ | null
\end{lstlisting}
Typing and evaluation of numeric, character, and string literals are
@@ -2290,20 +2288,20 @@ actual parameters, as in ~\lstinline@'$x$($\args\,$)@, then the whole expression
is taken to be a shorthand for
~\lstinline@scala.Labelled(scala.Symbol("$x$"), $\args\,$)@.
-\section{Boolean constants}
+\subsection{Boolean constants}
\begin{lstlisting}
- SimpleExpr ::= true | false
+ Literal ::= true | false
\end{lstlisting}
The boolean truth values are denoted by the reserved words \code{true}
and \code{false}. The type of these expressions is \code{boolean}, and
their evaluation is immediate.
-\section{The $\NULL$ Reference}
+\subsection{The $\NULL$ Reference}
\syntax\begin{lstlisting}
- SimpleExpr ::= null
+ Literal ::= null
\end{lstlisting}
The \code{null} expression is of type \lstinline@scala.AllRef@. It
@@ -3280,7 +3278,7 @@ Pattern2 ::= SimplePattern [ '*' |'?' | '+' ]
| SimplePattern { id SimplePattern }
SimplePattern ::= varid [ '@' SimplePattern ]
| `_'
- | literal
+ | Literal
| StableId [ `(' [Patterns] `)' ]
| `(' Patterns `)'
|
@@ -4149,11 +4147,14 @@ The context-free syntax of Scala is given by the following EBNF
grammar.
\begin{lstlisting}
- literal ::= intLit
+ Literal ::= intLit
| floatLit
| charLit
| stringLit
| symbolLit
+ | true
+ | false
+ | null
StableId ::= id
| Path `.' id
@@ -4178,7 +4179,7 @@ grammar.
|
Exprs ::= Expr {`,' Expr}
- Expr ::= [Bindings `=>'] Expr
+ Expr ::= Bindings `=>' Expr
| if `(' Expr `)' Expr [[`;'] else Expr]
| try `{' block `}' [catch Expr] [finally Expr]
| do Expr [`;'] while `(' Expr ')'
@@ -4192,10 +4193,7 @@ grammar.
InfixExpr ::= PrefixExpr
| InfixExpr id InfixExpr
PrefixExpr ::= [`-' | `+' | `~' | `!'] SimpleExpr
- SimpleExpr ::= literal
- | true
- | false
- | null
+ SimpleExpr ::= Literal
| Path
| `(' [Expr] `)'
| BlockExpr
@@ -4234,7 +4232,7 @@ grammar.
| SimplePattern { id SimplePattern }
SimplePattern ::= `_'
| varid
- | literal
+ | Literal
| StableId [ `(' [Patterns] `)' ]
| `(' [Patterns] `)'
Patterns ::= Pattern {`,' Pattern}