<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="314540" data-post-id="314540">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ityonemo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/120/11341_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ityonemo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sounds like a bug if you’re getting caseclause error.  Can you put an issue up with a repro?</p>
<p>Pegasus.Component is an internal tool that is used to help parse PEG grammars, those functions generate nimbleparsec definitions that are used internally by Pegasus.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="314540" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pegasus-peg-grammar-nimbleparsec-generator/57939/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-314540" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314540"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="314546" data-post-id="314546">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tj0" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tj0
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I was messing around a bit more, here’s an incomplete example of json parsing with PEG (a few post_traverse functions are missing). If you don’t tag or collect, the data comes in reverse. When collected/tagged, it is a charlist. There are quite a few post_traverse functions in here.</p>
<p>Also, for the curious, it doesn’t come close to the performance of <code>Jason</code>. Haven’t had a chance to do any profiling, so not sure where the bottlenecks are, but let’s be honest, having a human-readable grammar for JSON is pretty incredible.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule PegJSON do
  require Pegasus

  # https://www.json.org/json-en.html
  # https://github.com/azatoth/PanPG/blob/master/grammars/JSON.peg
  json_grammar = """
    json_parser &lt;- Value

    Value &lt;- S? ( Object / Array / String / True / False / Null / Number ) S?

    Object &lt;- ObjectStart
                ( ObjectPair ( Comma ObjectPair )*
                / S? )
            ObjectEnd
    ObjectStart &lt;- "{"
    ObjectEnd &lt;- "}"
    ObjectPair &lt;- String ":" Value
    Array &lt;- "["
                ( Value ( "," Value )*
                / S? )
            "]"
    String &lt;- S? ["] ( [^ " \ U+0000-U+001F ] / Escape )* ["] S?
    Escape &lt;- [\] ( [ " / \ b f n r t ] / UnicodeEscape )
    UnicodeEscape &lt;- "u" [0-9A-Fa-f] [0-9A-Fa-f] [0-9A-Fa-f] [0-9A-Fa-f]
    True &lt;- "true"
    False &lt;- "false"
    Null &lt;- "null"
    Comma &lt;- ","
    Number &lt;- Minus? IntegralPart FractionalPart? ExponentPart?
    Minus &lt;- "-"
    #IntegralPart &lt;- "0" / [1-9] [0-9]*
    IntegralPart &lt;- [0-9]*
    FractionalPart &lt;- "." [0-9]+
    ExponentPart &lt;- ( "e" / "E" ) ( "+" / "-" )? [0-9]+
    S &lt;- (' ' / '\t' / '\r\n' / '\n' / '\r')+
    #S &lt;- [ U+0009 U+000A U+000D U+0020 ]+
  """
  json_parser_opts = [
    json_parser: [export: true, parser: true],
    S: [ignore: true],
    Object: [tag: :object, post_traverse: {:post_object, []}],
    ObjectPair: [post_traverse: {:post_obj_pair, []}],
    ObjectStart: [ignore: true],
    ObjectEnd: [ignore: true],
    Array: [tag: :array],
    #String: [tag: :str, post_traverse: {:post_str, []}],
    String: [post_traverse: {:post_str, []}],
    Escape: [tag: :escape],
    Number: [tag: :number, post_traverse: {:post_number, []}],
    Comma: [ignore: true],
    #JSON: [tag: :json]
  ]

  defp post_obj_pair(rest, args, context, _line, _offset) do
    # IO.inspect rest
    # IO.inspect context
    [value, ":", key] = args
    {rest, [ {key, value}], context}
  end
  defp post_str(rest, args, context, _line, _offset) do
    #[str: str] = args
    #IO.inspect args
    #str = Enum.slice(args, 1..-2)|&gt; Enum.reverse |&gt; to_string
    str = Enum.slice(args, 1..-2)|&gt; to_string
    #str = to_string(Enum.slice(args, 1..-2))
    {rest, [ str ], context}
  end
  defp post_number(rest, args, context, _line, _offset) do
    [number: str] = args
    str = String.to_integer(to_string(str))
    {rest, [ str ], context}
  end
  defp post_object(rest, args, context, _line, _offset) do
    [object: object] = args
    obj = Enum.into(object, %{})
    {rest, [obj], context}
  end

  Pegasus.parser_from_string(json_grammar, json_parser_opts)

  def bench do
    t1 = "{\"a_key\":123,\"b_key\":456}"
    t4 = "{\"a_key\": \"here\",\"b_key\": \"done\"}"
    t3 = "{\"a\":1,\"b\":22}"
    t2 = "{\"a\":1,\"b\": 2}"
    Benchee.run( %{
    "jason_decode" =&gt; fn -&gt; Jason.decode(t1) end,
    "peg_json_decode" =&gt; fn -&gt; PegJSON.json_parser(t1) end,
    },
    print: [benchmarking: false, suite: false])
  end
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="314546" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pegasus-peg-grammar-nimbleparsec-generator/57939/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-314546" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314546"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="314550" data-post-id="314550">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jkwchui" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jkwchui
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for the examples. Having seen this I went back to NimbleParsec docs — I didn’t pick up that <code>post_traverse()</code> needs to return <code>{rest, List.t(), context}</code>, and had it return a map instead.  Maybe some Livebook tutorials may be helpful; I’ll see if I can build something after I’ve gotten more familiar.</p>
<p><strong>Edit</strong>  I had been parsing SVG path drawing instructions with very ugly regexes, with a series of</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">@path_extraction_QS ~r/(?&lt;draw&gt;[QqSs])((?&lt;x1&gt;[\d]+\.*[\d]*)+\s(?&lt;y1&gt;[\d]+\.*[\d]*)\s(?&lt;x2&gt;[\d]+\.*[\d]*)+\s(?&lt;y3&gt;[\d]+\.*[\d]*)+)+/
</code></pre>
<p>It’s totally worth the time to learn PEG / Pegasus.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Peg.SvgPath do
  import NimbleParsec
  require Pegasus

  @svg_instruction_options [
    Instructions: [tag: :instructions],
    
    ThreeXY:      [tag: :three_xy],
    TwoXY:        [tag: :two_xy],
    OneXY:        [tag: :one_xy],
    Directional:  [tag: :directional],
    Close:        [tag: :close],
    
    XYPair:   [tag: :xypair, post_traverse: :rename],
    Number:   [tag: :number, collect: true],
    
    Space:    [ignore: true]
  ]
  Pegasus.parser_from_string(
    """
    Instructions      &lt;- (ThreeXY / TwoXY / OneXY / Directional / Close)*

    ThreeXY           &lt;- [Cc] Triple_XYPairs
    TwoXY             &lt;- [QqSs] Double_XYPairs
    OneXY             &lt;- [MmLlTt] XYPair
    Directional       &lt;- [HhVv] Number
    Close             &lt;- [Zz]
    
    Triple_XYPairs    &lt;- XYPair Space XYPair Space XYPair
    Double_XYPairs    &lt;- XYPair Space XYPair
    XYPair            &lt;- Number Space Number

    Number            &lt;- Integer (DecimalSeparator Integer)?
    Integer           &lt;- [0-9]+
    DecimalSeparator  &lt;- "."

    Space           &lt;- ' '
    """,
    @svg_instruction_options
  )
  defparsec :get_instructions, parsec(:Instructions)

  defp rename(rest, args, context, _line, _offset) do
    [xypair: [number: [x], number: [y]]] = args
    {rest, [%{x: Decimal.new(x), y: Decimal.new(y)}], context}
  end
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="314550" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pegasus-peg-grammar-nimbleparsec-generator/57939/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-314550" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314550"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="314638" data-post-id="314638">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ityonemo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/120/11341_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ityonemo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tj0" data-post="13" data-topic="57939">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/t/48db29/48.png" class="avatar"> tj0:</div>
<blockquote>
<p>If you don’t tag or collect, the data comes in reverse</p>
</blockquote>
</aside>
<p>I believe that is a NimbleParsec thing.  I should add that to the documentation</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="314638" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pegasus-peg-grammar-nimbleparsec-generator/57939/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-314638" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314638"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="317091" data-post-id="317091">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jkwchui" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jkwchui
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m trying to use this to parse CJK strings, and I’m at a loss whether it is possible to designate unicode strings.  What I tried is:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule ExCantonese.Markup.Parser.MVP do
  import NimbleParsec
  require Pegasus

  def parse(markup) do
    {:ok, [cjk: results], _remainder, _, _, _} = parse_markup(markup)
    results
  end

  @cjk_options [
    CJK: [tag: :cjk],
    CJKchar: [tag: :cjk_char, collect: true]
  ]
  Pegasus.parser_from_string(
    """
    CJK               &lt;- CJKchar

    CJKchar           &lt;- [a-z]
                       / [\u3400-\u9FAF]
                       / [\u20021-\u2F8A6]
    """,
    @cjk_options
  )
  defparsec :parse_markup, parsec(:CJK)
end
</code></pre>
<p>Against test cases of</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">cjk_2a = "我"
cjk_2b = "三"
cjk_3 = "a"
</code></pre>
<p>I expected a return for <code>:cjk_char</code> of <code>["我"]</code>, <code>["三"]</code>, and <code>["a"]</code>, but instead received:</p>
<ul>
<li><code>[&lt;&lt;230&gt;&gt;]</code></li>
<li><code>[&lt;&lt;228&gt;&gt;]</code></li>
<li><code>["a"]</code></li>
</ul>
<p>I think this is matching the char, but collecting only the first bit.  Is this expected behaviour (in which case is it possible to work with non-alphanumeric ranges?)?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="317091" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pegasus-peg-grammar-nimbleparsec-generator/57939/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-317091" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="317091"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="317101" data-post-id="317101">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ityonemo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/120/11341_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ityonemo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You’ll have to do a byte by byte match.  The spec</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://www.piumarta.com/software/peg/peg.1.html">
  <header class="source">

      <a href="https://www.piumarta.com/software/peg/peg.1.html" target="_blank" rel="noopener nofollow ugc">piumarta.com</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://www.piumarta.com/software/peg/peg.1.html" target="_blank" rel="noopener nofollow ugc">PEG(1)</a></h3>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>Does not support \u.</p>
<p>You may want to check out how the zig parser handles “arbitrary Unicode”:</p>
<aside class="onebox githubblob" data-onebox-src="https://github.com/ziglang/zig-spec/blob/f7fb3d084285a296dcc63c89ac3d66e79571f79d/grammar/grammar.y#L391">
  <header class="source">

      <a href="https://github.com/ziglang/zig-spec/blob/f7fb3d084285a296dcc63c89ac3d66e79571f79d/grammar/grammar.y#L391" target="_blank" rel="noopener nofollow ugc">github.com/ziglang/zig-spec</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/ziglang/zig-spec/blob/f7fb3d084285a296dcc63c89ac3d66e79571f79d/grammar/grammar.y#L391" target="_blank" rel="noopener nofollow ugc">grammar/grammar.y</a></h4>

<div class="git-blob-info">
  <a href="https://github.com/ziglang/zig-spec/blob/f7fb3d084285a296dcc63c89ac3d66e79571f79d/grammar/grammar.y#L391" rel="noopener nofollow ugc"><code>f7fb3d084</code></a>
</div>



    <pre class="onebox"><code class="lang-y">
      <ol class="start lines" start="381" style="counter-reset: li-counter 380 ;">
          <li>oxF0 &lt;- '\360'</li>
          <li>ox90_0xBF &lt;- [\220-\277]</li>
          <li>oxEE_oxEF &lt;- [\356-\357]</li>
          <li>oxED &lt;- '\355'</li>
          <li>ox80_ox9F &lt;- [\200-\237]</li>
          <li>oxE1_oxEC &lt;- [\341-\354]</li>
          <li>oxE0 &lt;- '\340'</li>
          <li>oxA0_oxBF &lt;- [\240-\277]</li>
          <li>oxC2_oxDF &lt;- [\302-\337]</li>
          <li></li>
          <li class="selected"># From https://lemire.me/blog/2018/05/09/how-quickly-can-you-check-that-a-string-is-valid-unicode-utf-8/</li>
          <li># First Byte      Second Byte     Third Byte      Fourth Byte</li>
          <li># [0x00,0x7F]</li>
          <li># [0xC2,0xDF]     [0x80,0xBF]</li>
          <li>#    0xE0         [0xA0,0xBF]     [0x80,0xBF]</li>
          <li># [0xE1,0xEC]     [0x80,0xBF]     [0x80,0xBF]</li>
          <li>#    0xED         [0x80,0x9F]     [0x80,0xBF]</li>
          <li># [0xEE,0xEF]     [0x80,0xBF]     [0x80,0xBF]</li>
          <li>#    0xF0         [0x90,0xBF]     [0x80,0xBF]     [0x80,0xBF]</li>
          <li># [0xF1,0xF3]     [0x80,0xBF]     [0x80,0xBF]     [0x80,0xBF]</li>
          <li>#    0xF4         [0x80,0x8F]     [0x80,0xBF]     [0x80,0xBF]</li>
      </ol>
    </code></pre>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="317101" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pegasus-peg-grammar-nimbleparsec-generator/57939/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-317101" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="317101"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="317550" data-post-id="317550">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="TwistingTwists" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/TwistingTwists/120/21564_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  TwistingTwists
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>What is the syntax for matching byte?</p>
<p>I want to match <code>–</code> which is a special character with hex code <code>0x2013</code>.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule MyParser2 do 
  import NimbleParsec
  require Pegasus
  

  Pegasus.parser_from_string(
  """
  header    &lt;- colon / special_minus 
  colon         &lt;- ":" 
  special_minus &lt;- "0x2013"

 """)

  defparsec :parse_question, parsec(:header)

end
</code></pre>
<p><code>MyParser2.parse_question("–")</code></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{:error, "expected string \"0x2013\"", "–", %{}, {1, 0}, 0}


</code></pre>
<p>Also, tried the following</p>
<p><code>  special_minus &lt;- 0x2013</code><br>
<code>  special_minus &lt;- [0x2013]</code></p>
<p>None of them compile.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="317550" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pegasus-peg-grammar-nimbleparsec-generator/57939/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-317550" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="317550"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="317554" data-post-id="317554">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="TwistingTwists" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/TwistingTwists/120/21564_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  TwistingTwists
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="onebox githubblob" data-onebox-src="https://github.com/E-xyza/Exonerate/blob/1a639563a64ee1bf2b3ad4417871c3d3034c7077/lib/exonerate/formats/iri.ex#L115-L123">
  <header class="source">

      <a href="https://github.com/E-xyza/Exonerate/blob/1a639563a64ee1bf2b3ad4417871c3d3034c7077/lib/exonerate/formats/iri.ex#L115-L123" target="_blank" rel="noopener nofollow ugc">github.com/E-xyza/Exonerate</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/E-xyza/Exonerate/blob/1a639563a64ee1bf2b3ad4417871c3d3034c7077/lib/exonerate/formats/iri.ex#L115-L123" target="_blank" rel="noopener nofollow ugc">lib/exonerate/formats/iri.ex</a></h4>

<div class="git-blob-info">
  <a href="https://github.com/E-xyza/Exonerate/blob/1a639563a64ee1bf2b3ad4417871c3d3034c7077/lib/exonerate/formats/iri.ex#L115-L123" rel="noopener nofollow ugc"><code>1a639563a</code></a>
</div>



    <pre class="onebox"><code class="lang-ex">
      <ol class="start lines" start="115" style="counter-reset: li-counter 114 ;">
          <li>defcombinatorp(</li>
          <li>  :IRI_ucschar,</li>
          <li>  utf8_char(</li>
          <li>    not: 0..127,</li>
          <li>    not: 0xE000..0xF8FF,</li>
          <li>    not: 0xF0000..0xFFFFD,</li>
          <li>    not: 0x100000..0x10FFFD</li>
          <li>  )</li>
          <li>)</li>
      </ol>
    </code></pre>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>Wow. Combining PEG grammars with Nimbleparsec is :chef_kiss:  <img src="https://forum.elixirforum.com/images/emoji/apple/pinched_fingers.png?v=15" title=":pinched_fingers:" class="emoji" alt=":pinched_fingers:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="317554" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pegasus-peg-grammar-nimbleparsec-generator/57939/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-317554" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="317554"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>