summaryrefslogtreecommitdiff
path: root/sources/examples/parsers1.scala
diff options
context:
space:
mode:
Diffstat (limited to 'sources/examples/parsers1.scala')
-rw-r--r--sources/examples/parsers1.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/examples/parsers1.scala b/sources/examples/parsers1.scala
index 2ed0f4be4b..143f354049 100644
--- a/sources/examples/parsers1.scala
+++ b/sources/examples/parsers1.scala
@@ -14,7 +14,7 @@ object parsers1 {
/*** p &&& q applies first p, and if that succeeds, then q
*/
- def &&& (def q: Parser) = new Parser {
+ def &&& (q: => Parser) = new Parser {
def apply(in: inputType): Result = Parser.this.apply(in) match {
case None => None
case Some(in1) => q(in1)
@@ -23,7 +23,7 @@ object parsers1 {
/*** p ||| q applies first p, and, if that fails, then q.
*/
- def ||| (def q: Parser) = new Parser {
+ def ||| (q: => Parser) = new Parser {
def apply(in: inputType): Result = Parser.this.apply(in) match {
case None => q(in)
case s => s