Skip to content

Commit

Permalink
Generate (6cac15d)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 1, 2024
1 parent 91af162 commit bfde28c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 42 deletions.
42 changes: 25 additions & 17 deletions REXML/IOSource.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ <h3>Public Instance Methods</h3>
<p>@return the current line in the source</p>

<div class="method-source-code" id="current_line-source">
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 264</span>
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 274</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_line</span>
<span class="ruby-keyword">begin</span>
<span class="ruby-identifier">pos</span> = <span class="ruby-ivar">@er_source</span>.<span class="ruby-identifier">pos</span> <span class="ruby-comment"># The byte position in the source</span>
Expand Down Expand Up @@ -215,7 +215,7 @@ <h3>Public Instance Methods</h3>
</div>

<div class="method-source-code" id="empty-3F-source">
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 259</span>
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 269</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">empty?</span>
<span class="ruby-keyword">super</span> <span class="ruby-keyword">and</span> ( <span class="ruby-ivar">@source</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@source</span>.<span class="ruby-identifier">eof?</span> )
<span class="ruby-keyword">end</span></pre>
Expand All @@ -238,7 +238,7 @@ <h3>Public Instance Methods</h3>


<div class="method-source-code" id="ensure_buffer-source">
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 236</span>
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 246</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ensure_buffer</span>
<span class="ruby-identifier">read</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">eos?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@source</span>
<span class="ruby-keyword">end</span></pre>
Expand All @@ -252,22 +252,19 @@ <h3>Public Instance Methods</h3>
<div class="method-header">
<div class="method-heading">
<span class="method-name">match</span><span
class="method-args">( pattern, cons=false, term: nil )</span>
class="method-args">( pattern, cons=false )</span>
<span class="method-click-advice">click to toggle source</span>
</div>
</div>

<div class="method-description">
<p>Note: When specifying a string for ‘pattern’, it must not include ‘&gt;’ except in the following formats:</p>
<ul><li>
<p>“&gt;”</p>
</li><li>
<p>“XXX&gt;” (X is any string excluding ‘&gt;’)</p>
</li></ul>


<div class="method-source-code" id="match-source">
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 243</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">match</span>( <span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">cons</span>=<span class="ruby-keyword">false</span>, <span class="ruby-value">term:</span> <span class="ruby-keyword">nil</span> )
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 250</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">match</span>( <span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">cons</span>=<span class="ruby-keyword">false</span> )
<span class="ruby-comment"># To avoid performance issue, we need to increase bytes to read per scan</span>
<span class="ruby-identifier">min_bytes</span> = <span class="ruby-value">1</span>
<span class="ruby-keyword">while</span> <span class="ruby-keyword">true</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">cons</span>
<span class="ruby-identifier">md</span> = <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">pattern</span>)
Expand All @@ -277,7 +274,8 @@ <h3>Public Instance Methods</h3>
<span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">md</span>
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@source</span>.<span class="ruby-identifier">nil?</span>
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">read</span>(<span class="ruby-identifier">term</span>)
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">read</span>(<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">min_bytes</span>)
<span class="ruby-identifier">min_bytes</span> <span class="ruby-operator">*=</span> <span class="ruby-value">2</span>
<span class="ruby-keyword">end</span>

<span class="ruby-identifier">md</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@scanner</span>
Expand All @@ -292,7 +290,7 @@ <h3>Public Instance Methods</h3>
<div class="method-header">
<div class="method-heading">
<span class="method-name">read</span><span
class="method-args">(term = nil)</span>
class="method-args">(term = nil, min_bytes = 1)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
</div>
Expand All @@ -302,10 +300,20 @@ <h3>Public Instance Methods</h3>

<div class="method-source-code" id="read-source">
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 207</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">read</span>(<span class="ruby-identifier">term</span> = <span class="ruby-keyword">nil</span>)
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">read</span>(<span class="ruby-identifier">term</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">min_bytes</span> = <span class="ruby-value">1</span>)
<span class="ruby-identifier">term</span> = <span class="ruby-identifier">encode</span>(<span class="ruby-identifier">term</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">term</span>
<span class="ruby-keyword">begin</span>
<span class="ruby-ivar">@scanner</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">readline</span>(<span class="ruby-identifier">term</span>)
<span class="ruby-identifier">str</span> = <span class="ruby-identifier">readline</span>(<span class="ruby-identifier">term</span>)
<span class="ruby-ivar">@scanner</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>
<span class="ruby-identifier">read_bytes</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">bytesize</span>
<span class="ruby-keyword">begin</span>
<span class="ruby-keyword">while</span> <span class="ruby-identifier">read_bytes</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">min_bytes</span>
<span class="ruby-identifier">str</span> = <span class="ruby-identifier">readline</span>(<span class="ruby-identifier">term</span>)
<span class="ruby-ivar">@scanner</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>
<span class="ruby-identifier">read_bytes</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">bytesize</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">IOError</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">true</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span>, <span class="ruby-constant">NameError</span>
<span class="ruby-ivar">@source</span> = <span class="ruby-keyword">nil</span>
Expand All @@ -331,7 +339,7 @@ <h3>Public Instance Methods</h3>


<div class="method-source-code" id="read_until-source">
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 218</span>
<pre><span class="ruby-comment"># File lib/rexml/source.rb, line 228</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">read_until</span>(<span class="ruby-identifier">term</span>)
<span class="ruby-identifier">pattern</span> = <span class="ruby-constant">Private</span><span class="ruby-operator">::</span><span class="ruby-constant">PRE_DEFINED_TERM_PATTERNS</span>[<span class="ruby-identifier">term</span>] <span class="ruby-operator">||</span> <span class="ruby-regexp">/#{Regexp.escape(term)}/</span>
<span class="ruby-identifier">term</span> = <span class="ruby-identifier">encode</span>(<span class="ruby-identifier">term</span>)
Expand Down
24 changes: 12 additions & 12 deletions REXML/Parsers/BaseParser.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ <h3>Public Class Methods</h3>


<div class="method-source-code" id="new-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 153</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 145</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>( <span class="ruby-identifier">source</span> )
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">stream</span> = <span class="ruby-identifier">source</span>
<span class="ruby-ivar">@listeners</span> = []
Expand Down Expand Up @@ -341,7 +341,7 @@ <h3>Public Instance Methods</h3>


<div class="method-source-code" id="add_listener-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 160</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 152</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_listener</span>( <span class="ruby-identifier">listener</span> )
<span class="ruby-ivar">@listeners</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">listener</span>
<span class="ruby-keyword">end</span></pre>
Expand All @@ -364,7 +364,7 @@ <h3>Public Instance Methods</h3>
<p>Returns true if there are no more events</p>

<div class="method-source-code" id="empty-3F-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 188</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 180</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">empty?</span>
<span class="ruby-keyword">return</span> (<span class="ruby-ivar">@source</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">empty?</span>)
<span class="ruby-keyword">end</span></pre>
Expand All @@ -387,7 +387,7 @@ <h3>Public Instance Methods</h3>


<div class="method-source-code" id="entity-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 515</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 507</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entity</span>( <span class="ruby-identifier">reference</span>, <span class="ruby-identifier">entities</span> )
<span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">entities</span>[ <span class="ruby-identifier">reference</span> ] <span class="ruby-keyword">if</span> <span class="ruby-identifier">entities</span>
Expand Down Expand Up @@ -418,7 +418,7 @@ <h3>Public Instance Methods</h3>
<p>Returns true if there are more events. Synonymous with !empty?</p>

<div class="method-source-code" id="has_next-3F-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 193</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 185</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">has_next?</span>
<span class="ruby-keyword">return</span> <span class="ruby-operator">!</span>(<span class="ruby-ivar">@source</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">empty?</span>)
<span class="ruby-keyword">end</span></pre>
Expand All @@ -441,7 +441,7 @@ <h3>Public Instance Methods</h3>
<p>Escapes all possible entities</p>

<div class="method-source-code" id="normalize-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 528</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 520</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalize</span>( <span class="ruby-identifier">input</span>, <span class="ruby-identifier">entities</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">entity_filter</span>=<span class="ruby-keyword">nil</span> )
<span class="ruby-identifier">copy</span> = <span class="ruby-identifier">input</span>.<span class="ruby-identifier">clone</span>
<span class="ruby-comment"># Doing it like this rather than in a loop improves the speed</span>
Expand Down Expand Up @@ -475,7 +475,7 @@ <h3>Public Instance Methods</h3>
<p>Peek at the <code>depth</code> event in the stack. The first element on the stack is at depth 0. If <code>depth</code> is -1, will parse to the end of the input stream and return the last event, which is always :end_document. Be aware that this causes the stream to be parsed up to the <code>depth</code> event, so you can effectively pre-parse the entire document (pull the entire thing into memory) using this method.</p>

<div class="method-source-code" id="peek-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 209</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 201</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">peek</span> <span class="ruby-identifier">depth</span>=<span class="ruby-value">0</span>
<span class="ruby-identifier">raise</span> <span class="ruby-node">%Q[Illegal argument &quot;#{depth}&quot;]</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">-1</span>
<span class="ruby-identifier">temp</span> = []
Expand Down Expand Up @@ -508,7 +508,7 @@ <h3>Public Instance Methods</h3>


<div class="method-source-code" id="position-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 178</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 170</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">position</span>
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@source</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:position</span>
<span class="ruby-ivar">@source</span>.<span class="ruby-identifier">position</span>
Expand Down Expand Up @@ -536,7 +536,7 @@ <h3>Public Instance Methods</h3>
<p>Returns the next event. This is a <code>PullEvent</code> object.</p>

<div class="method-source-code" id="pull-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 224</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 216</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pull</span>
<span class="ruby-ivar">@source</span>.<span class="ruby-identifier">drop_parsed_content</span>

Expand Down Expand Up @@ -565,7 +565,7 @@ <h3>Public Instance Methods</h3>


<div class="method-source-code" id="stream-3D-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 167</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 159</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">stream=</span>( <span class="ruby-identifier">source</span> )
<span class="ruby-ivar">@source</span> = <span class="ruby-constant">SourceFactory</span>.<span class="ruby-identifier">create_from</span>( <span class="ruby-identifier">source</span> )
<span class="ruby-ivar">@closed</span> = <span class="ruby-keyword">nil</span>
Expand Down Expand Up @@ -595,7 +595,7 @@ <h3>Public Instance Methods</h3>
<p>Unescapes all possible entities</p>

<div class="method-source-code" id="unnormalize-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 544</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 536</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unnormalize</span>( <span class="ruby-identifier">string</span>, <span class="ruby-identifier">entities</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">filter</span>=<span class="ruby-keyword">nil</span> )
<span class="ruby-keyword">if</span> <span class="ruby-identifier">string</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;\r&quot;</span>)
<span class="ruby-identifier">rv</span> = <span class="ruby-identifier">string</span>.<span class="ruby-identifier">gsub</span>( <span class="ruby-constant">Private</span><span class="ruby-operator">::</span><span class="ruby-constant">CARRIAGE_RETURN_NEWLINE_PATTERN</span>, <span class="ruby-string">&quot;\n&quot;</span> )
Expand Down Expand Up @@ -651,7 +651,7 @@ <h3>Public Instance Methods</h3>
<p>Push an event back on the head of the stream. This method has (theoretically) infinite depth.</p>

<div class="method-source-code" id="unshift-source">
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 199</span>
<pre><span class="ruby-comment"># File lib/rexml/parsers/baseparser.rb, line 191</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unshift</span> <span class="ruby-identifier">token</span>
<span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-identifier">token</span>)
<span class="ruby-keyword">end</span></pre>
Expand Down
Loading

0 comments on commit bfde28c

Please sign in to comment.