title: Boost Spirit new line and end of input
body: <p>I am trying to write a parser using Boost Spirit which parses a scripting language of statements ended by a new line OR end of input. Therefore I wrote a custom skipper which skips blanks and one line comments (// bla bla) detects end of input and end of line but does not consume so that all expressions can be ended with an "eol" or "eoi" explicitely.
  Unfortunately, the program seems to parse either endlessly or does have an error for the last statement which is ended by eoi and not eol and I don't know how to split expressions properly:</p>
  
  <pre><code>*qi::eol &gt;&gt; (*(qi::char_ - (qi::eol)) % (+qi::eol)) &gt;&gt; qi::eoi
  </code></pre>
  
  <p>this one works except for the last statement which is ended by eoi which makes sense since it expects at least one eol for all lines.
  The following statement parses endlessly:</p>
  
  <pre><code>*qi::eol &gt;&gt; (*(qi::char_ - (qi::eol)) % (+qi::eol | &amp;qi::eoi)) &gt;&gt; qi::eoi
  </code></pre>
  
  <p>It should not consume the eoi but accept it as a valid end of the statement. It still is excpected as last char.</p>
  
  <p>the skipper has the following statement:</p>
  
  <pre><code> blank | lit("//") &gt;&gt; *(char_ - (eol | eoi) ) &gt;&gt; (&amp;eol | &amp;eoi)
  </code></pre>
  
  <p>In the end I want to get a list of strings each representing one line. For tests I use the following input:</p>
  
  <pre><code>// This is a comment in the first line 1234567890!"$?:;.-_+/=
  globals
      integer bla = 10 // This is a comment after an expression
  endglobals
  // This is a comment in the last line
  type bla extends integer
  </code></pre>
  
  <p>I would expect 6 strings of which two are empty because there are only comments. For the statement</p>
  
  <pre><code>integer bla = 10 // This is a comment after an expression
  </code></pre>
  
  <p>it simply should cut the comment and the blanks so</p>
  
  <pre><code>integerbla=10
  </code></pre>
  
  <p>should be the resulting string.</p>
  
  <p>If you have any better idea how to write such grammars please tell me!</p>