import{_ as a,c as n,o as e,a4 as s}from"./chunks/framework.Cy9JvDAg.js";const _=JSON.parse('{"title":"3.4 - 表达式","description":"","frontmatter":{"title":"3.4 - 表达式","footer":true,"lastUpdated":true,"outline":false},"headers":[],"relativePath":"3.4.md","filePath":"3.4.md"}'),l={name:"3.4.md"},p=s(`<h2 id="_3-4-表达式" tabindex="-1">3.4 - 表达式 <a class="header-anchor" href="#_3-4-表达式" aria-label="Permalink to &quot;3.4 - 表达式&quot;">​</a></h2><p>以下是Lua中基本的表示式：</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>exp ::= prefixexp</span></span>
<span class="line"><span>exp ::= nil | false | true</span></span>
<span class="line"><span>exp ::= Numeral</span></span>
<span class="line"><span>exp ::= LiteralString</span></span>
<span class="line"><span>exp ::= functiondef</span></span>
<span class="line"><span>exp ::= tableconstructor</span></span>
<span class="line"><span>exp ::= ‘...’</span></span>
<span class="line"><span>exp ::= exp binop exp</span></span>
<span class="line"><span>exp ::= unop exp</span></span>
<span class="line"><span>prefixexp ::= var | functioncall | ‘(’ exp ‘)’</span></span></code></pre></div><p>数字和文本字符串参见<a href="/lua5.4-manual-zh/3.1.html">3.1</a>；变量相关参见<a href="/lua5.4-manual-zh/3.2.html">3.2</a>；方法定义参见<a href="/lua5.4-manual-zh/3.4.11.html">3.4.11</a>；方法调用参见<a href="/lua5.4-manual-zh/3.4.10.html">3.4.10</a>；表的构造参见<a href="/lua5.4-manual-zh/3.4.9.html">3.4.9</a>。可变参数表达式，其表示为三个点（&#39;...&#39;），只能直接在可变参数方法中使用；相关解释请参见<a href="/lua5.4-manual-zh/3.4.11.html">3.4.11</a>。</p><p>二元操作包含算术操作（参见<a href="/lua5.4-manual-zh/3.4.1.html">3.4.1</a>）、位操作（参见<a href="/lua5.4-manual-zh/3.4.2.html">3.4.2</a>）、关系操作（参见<a href="/lua5.4-manual-zh/3.4.4.html">3.4.4</a>）、逻辑操作（参见<a href="/lua5.4-manual-zh/3.4.5.html">3.4.5</a>）以及连接操作（参见<a href="/lua5.4-manual-zh/3.4.6.html">3.4.6</a>）。一元操作包含取负操作（参见<a href="/lua5.4-manual-zh/3.4.1.html">3.4.1</a>）、按位否操作（参见<a href="/lua5.4-manual-zh/3.4.2.html">3.4.2</a>）、逻辑<strong>非</strong>操作（参见<a href="/lua5.4-manual-zh/3.4.5.html">3.4.5</a>）以及<em>取长操作</em>（参见<a href="/lua5.4-manual-zh/3.4.7.html">3.4.7</a>）。</p>`,5),t=[p];function h(r,u,i,m,o,c){return e(),n("div",null,t)}const d=a(l,[["render",h]]);export{_ as __pageData,d as default};
