mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Deploying to gh-pages from @ bedf3a68d7
🚀
This commit is contained in:
parent
783b1f1658
commit
edc349b964
93 changed files with 3493 additions and 1634 deletions
|
@ -3,28 +3,28 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<meta name="crystal_docs.project_version" content="0.13.3-dev">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="crystal_docs.project_version" content="master">
|
||||
<meta name="crystal_docs.project_name" content="ameba">
|
||||
|
||||
|
||||
|
||||
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../../js/doc.js"></script>
|
||||
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::AST::Variable - ameba 0.13.3-dev</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<svg class="hidden">
|
||||
<symbol id="octicon-link" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
||||
<meta id="repository-name" content="ameba">
|
||||
<title>Ameba::AST::Variable - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
@ -39,12 +39,12 @@
|
|||
</h1>
|
||||
|
||||
<span class="project-version">
|
||||
0.13.3-dev
|
||||
master
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results hidden">
|
||||
<div class="search-results" class="hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
@ -613,6 +613,13 @@ Holds the var node and variable assigments.</p>
|
|||
Defined in:
|
||||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L4" target="_blank">
|
||||
ameba/ast/variabling/variable.cr
|
||||
</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -855,12 +862,14 @@ Holds the var node and variable assigments.</p>
|
|||
|
||||
<p>Creates a new variable(in the scope).</p>
|
||||
|
||||
<pre><code class="language-crystal"><span class="t">Variable</span>.<span class="k">new</span>(node, scope)</code></pre>
|
||||
<pre><code><span class="t">Variable</span>.<span class="k">new</span>(node, scope)</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L31" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -891,7 +900,7 @@ Holds the var node and variable assigments.</p>
|
|||
<p>Assigns the variable (creates a new assignment).
|
||||
Variable may have multiple assignments.</p>
|
||||
|
||||
<pre><code class="language-crystal">variable <span class="o">=</span> <span class="t">Variable</span>.<span class="k">new</span>(node, scope)
|
||||
<pre><code>variable <span class="o">=</span> <span class="t">Variable</span>.<span class="k">new</span>(node, scope)
|
||||
variable.assign(node1)
|
||||
variable.assign(node2)
|
||||
variable.assignment.size <span class="c"># => 2</span></code></pre>
|
||||
|
@ -900,6 +909,8 @@ variable.assignment.size <span class="c"># => 2</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L49" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -919,6 +930,8 @@ variable.assignment.size <span class="c"># => 2</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L18" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -938,6 +951,8 @@ variable.assignment.size <span class="c"># => 2</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L6" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -955,18 +970,20 @@ variable.assignment.size <span class="c"># => 2</span></code></pre>
|
|||
in the block. For example this variable is captured
|
||||
by block:</p>
|
||||
|
||||
<pre><code class="language-crystal">a <span class="o">=</span> <span class="n">1</span>
|
||||
<pre><code>a <span class="o">=</span> <span class="n">1</span>
|
||||
<span class="n">3</span>.times { <span class="o">|</span>i<span class="o">|</span> a <span class="o">=</span> a <span class="o">+</span> i }</code></pre>
|
||||
|
||||
<p>And this variable is not captured by block.</p>
|
||||
|
||||
<pre><code class="language-crystal">i <span class="o">=</span> <span class="n">1</span>
|
||||
<pre><code>i <span class="o">=</span> <span class="n">1</span>
|
||||
<span class="n">3</span>.times { <span class="o">|</span>i<span class="o">|</span> i <span class="o">+</span> <span class="n">1</span> }</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L114" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -986,6 +1003,8 @@ by block:</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L160" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1000,6 +1019,8 @@ by block:</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L21" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1014,6 +1035,8 @@ by block:</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L21" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1034,6 +1057,8 @@ the same Crystal node as <code>@node</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L153" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1053,6 +1078,8 @@ the same Crystal node as <code>@node</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L147" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1067,6 +1094,8 @@ the same Crystal node as <code>@node</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L20" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1081,6 +1110,8 @@ the same Crystal node as <code>@node</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L20" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1095,6 +1126,8 @@ the same Crystal node as <code>@node</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L22" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1109,6 +1142,8 @@ the same Crystal node as <code>@node</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L22" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1128,6 +1163,8 @@ the same Crystal node as <code>@node</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L12" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1143,13 +1180,15 @@ the same Crystal node as <code>@node</code>.</p>
|
|||
|
||||
<p>Creates a reference to this variable in some scope.</p>
|
||||
|
||||
<pre><code class="language-crystal">variable <span class="o">=</span> <span class="t">Variable</span>.<span class="k">new</span>(node, scope)
|
||||
<pre><code>variable <span class="o">=</span> <span class="t">Variable</span>.<span class="k">new</span>(node, scope)
|
||||
variable.reference(var_node, some_scope)</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L73" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1165,7 +1204,7 @@ variable.reference(var_node, some_scope)</code></pre>
|
|||
|
||||
<p>Reference variable's assignments.</p>
|
||||
|
||||
<pre><code class="language-crystal">variable <span class="o">=</span> <span class="t">Variable</span>.<span class="k">new</span>(node, scope)
|
||||
<pre><code>variable <span class="o">=</span> <span class="t">Variable</span>.<span class="k">new</span>(node, scope)
|
||||
variable.assign(assign_node)
|
||||
variable.reference_assignments!</code></pre>
|
||||
</div>
|
||||
|
@ -1173,6 +1212,8 @@ variable.reference_assignments!</code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L87" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1188,7 +1229,7 @@ variable.reference_assignments!</code></pre>
|
|||
|
||||
<p>Returns true if variable has any reference.</p>
|
||||
|
||||
<pre><code class="language-crystal">variable <span class="o">=</span> <span class="t">Variable</span>.<span class="k">new</span>(node, scope)
|
||||
<pre><code>variable <span class="o">=</span> <span class="t">Variable</span>.<span class="k">new</span>(node, scope)
|
||||
variable.reference(var_node)
|
||||
variable.referenced? <span class="c"># => true</span></code></pre>
|
||||
</div>
|
||||
|
@ -1196,6 +1237,8 @@ variable.referenced? <span class="c"># => true</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L62" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1215,6 +1258,8 @@ variable.referenced? <span class="c"># => true</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L9" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1234,6 +1279,8 @@ variable.referenced? <span class="c"># => true</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L15" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1253,6 +1300,8 @@ variable.referenced? <span class="c"># => true</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L35" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1273,6 +1322,8 @@ false otherwise.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L135" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1287,6 +1338,8 @@ false otherwise.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L23" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1301,6 +1354,8 @@ false otherwise.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L23" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1321,6 +1376,8 @@ false if not.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/ast/variabling/variable.cr#L125" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue