long, especially towards the end. There is no way of knowing for the
parser when to stop processing <code>infinity</code> and start reading
semicolons. Ergo, we need to make sure we talk about concrete items that
consume input first, and then do recursion. This way we ensure that our
grammar terminates, since in a way, it is like a normal program.</p>
<p>Here&#8217;s the full parser:</p>
<pre class="sh_ruby"><code title="full_parser">  
  class Mini &lt; Parslet::Parser
    rule(:integer)    { match('[0-9]'