title: Boost Spirit X3 Skip Parser Implementation?
body: <p>For the current grammar I am parsing with X3, whitespace and Perl-style comments are ignored.</p>
  
  <p>It seems to me that a skip parser in X3 is just a normal parser, and whatever input it consumes is considered "skipped." I came up with this:</p>
  
  <pre><code>namespace x3 = boost::spirit::x3;
  auto const blank_comment = 
     x3::blank | x3::lexeme[ '#' &gt;&gt; *(x3::char_ - x3::eol) &gt;&gt; x3::eol ];
  </code></pre>
  
  <p>On parsing a very basic input (a couple comment lines and one quoted string line), this seems to work well. (<a href="http://coliru.stacked-crooked.com/a/b7e58ddcb568593b" rel="nofollow noreferrer">Live on Coliru</a>)</p>
  
  <p>However, as I can't find any documentation on the matter and the details of current skip parsers are tucked away in an intricate system of templates, I was hoping for some input.</p>
  
  <ol>
  <li>Is this the proper way of defining a "skip parser"? Is there a standard method?</li>
  <li>Are there performance concerns with an implementation like this? How would it be improved?</li>
  </ol>
  
  <p>I previously searched SO for the details, and found an answer using Qi (<a href="https://stackoverflow.com/questions/8521314/custom-skip-parser-with-boostspirit">Custom Skip Parser with Boost::Spirit</a>). As I never learned Qi, much of the details are hard to follow. The method I described above seems more intuitive.</p>