title: Unexpected Result from Parser Test
body: <p>In the following parser:</p>
  
  <pre><code>object Foo extends JavaTokenParsers { 
  
    def word(x: String) = s"\\b$x\\b".r
  
    lazy val expr  = (foo ~ (conjGuard ~&gt; rep(conj ~ noun))) | foo
  
    def noun      = {println("noun"); word("noun")}
    def conj      = {println("conj"); word("and") }
    def conjGuard = {println("conjGuard"); guard(conj) | f }
    def f         = {println("failure"); (" *".r) ~ failure("bad conj!")}
  
    def foo = {println("foo"); word("foo")}
  }
  </code></pre>
  
  <p>Why is the following example printing out <code>conj</code> as the last printout? Where's it coming from?</p>
  
  <pre><code>scala&gt; Foo.parseAll(Foo.expr, "foo and noun")
  foo
  conjGuard
  conj
  conj
  noun
  conj
  res71: Foo.ParseResult[java.io.Serializable] = [1.13] parsed: 
          (foo~List((and~noun)))
  </code></pre>
  
  <p>Also, why isn't <code>foo</code> printing out first in this example?</p>
  
  <pre><code>scala&gt; Foo.parseAll(Foo.expr, "foo an3 noun")
  conj
  failure
  foo
  res72: Foo.ParseResult[java.io.Serializable] =
  [1.5] failure: string matching regex `\z' expected but `a' found
  
  foo an3 noun
      ^
  </code></pre>