-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
39 lines (38 loc) · 6.72 KB
/
index.html
File metadata and controls
39 lines (38 loc) · 6.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/>
<link rel="stylesheet" href="/umi.eb884056.css" />
<script>
window.routerBase = "/";
</script>
<script>
//! umi version: 3.3.1
</script>
<script
src="https://www.googletagmanager.com/gtag/js?id=UA-89371431-6"
async="true"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "UA-89371431-6");
</script>
<title>字面量</title>
</head>
<body>
<div id="root"><div class="__dumi-default-layout" data-show-sidemenu="true" data-show-slugs="true" data-site-mode="true" data-gapless="false"><div class="__dumi-default-navbar" data-mode="site"><button class="__dumi-default-navbar-toggle"></button><a class="__dumi-default-navbar-logo" href="/">StaticScript</a><nav><div class="__dumi-default-search"><input type="search" class="__dumi-default-search-input" value=""/><ul></ul></div><a aria-current="page" class="active" href="/guide">指南</a><a target="_blank" rel="noopener noreferrer" href="https://github.com/StaticScript/StaticScript">GitHub<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="__dumi-default-external-link-icon"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a><div class="__dumi-default-locale-select" data-locale-count="2"><span>English</span></div></nav></div><div class="__dumi-default-menu" data-mode="site"><div class="__dumi-default-menu-inner"><div class="__dumi-default-menu-header"><a class="__dumi-default-menu-logo" href="/"></a><h1>StaticScript</h1><p></p></div><div class="__dumi-default-menu-mobile-area"><ul class="__dumi-default-menu-nav-list"><li><a aria-current="page" class="active" href="/guide">指南</a></li><li><a target="_blank" rel="noopener noreferrer" href="https://github.com/StaticScript/StaticScript">GitHub<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="__dumi-default-external-link-icon"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul><div class="__dumi-default-locale-select" data-locale-count="2"><span>English</span></div></div><ul class="__dumi-default-menu-list"><li><a href="/guide">介绍</a></li><li><a href="/guide/install">安装</a></li><li><a href="/guide/getting-started">快速上手</a></li><li><a href="/guide/type">类型</a></li><li><a href="/guide/variable&constant">变量与常量</a></li><li><a aria-current="page" class="active" href="/guide/literal">字面量</a></li><li><a href="/guide/operators">运算符</a></li><li><a href="/guide/integer&float">整数与浮点数</a></li></ul></div></div><ul class="__dumi-default-layout-toc" role="slug-list"><li title="概述" data-depth="2" class=""><a href="/guide/literal#概述"><span>概述</span></a></li><li title="基本值字面量" data-depth="2" class=""><a href="/guide/literal#基本值字面量"><span>基本值字面量</span></a></li><li title="布尔字面量" data-depth="3" class=""><a href="/guide/literal#布尔字面量"><span>布尔字面量</span></a></li><li title="整数字面量" data-depth="3" class=""><a href="/guide/literal#整数字面量"><span>整数字面量</span></a></li><li title="浮点数字面量" data-depth="3" class=""><a href="/guide/literal#浮点数字面量"><span>浮点数字面量</span></a></li><li title="字符串字面量" data-depth="3" class=""><a href="/guide/literal#字符串字面量"><span>字符串字面量</span></a></li><li title="数组字面量" data-depth="2" class=""><a href="/guide/literal#数组字面量"><span>数组字面量</span></a></li></ul><div class="__dumi-default-layout-content"><div class="markdown"><h2 id="概述"><a aria-hidden="true" href="#概述"><span class="icon icon-link"></span></a>概述</h2><p>像 <code>1</code> <code>2.2</code> <code>true</code> <code>"hi"</code>这样的固定值叫做字面量</p><h2 id="基本值字面量"><a aria-hidden="true" href="#基本值字面量"><span class="icon icon-link"></span></a>基本值字面量</h2><h3 id="布尔字面量"><a aria-hidden="true" href="#布尔字面量"><span class="icon icon-link"></span></a>布尔字面量</h3><p>在 StaticScript 中只存在两种布尔字面量, 即<code>true</code> 和 <code>false</code></p><h3 id="整数字面量"><a aria-hidden="true" href="#整数字面量"><span class="icon icon-link"></span></a>整数字面量</h3><p>StaticScript 支持二进制/八进制/十进制/十六进制整数字面量</p><ul><li>二进制整数字面量必须以<code>0b</code>开头, 例如<code>0b1011</code></li><li>八进制整数字面量必须以<code>0o</code>开头, 例如<code>0o777</code></li><li>十六进制整数字面量必须以<code>0x</code>开头, 例如<code>0x49</code></li></ul><p>StaticScript 的十进制整数字面量表示与 TypeScript 相同</p><h3 id="浮点数字面量"><a aria-hidden="true" href="#浮点数字面量"><span class="icon icon-link"></span></a>浮点数字面量</h3><p>StaticScript 的浮点数字面量表示与 TypeScript 相同</p><h3 id="字符串字面量"><a aria-hidden="true" href="#字符串字面量"><span class="icon icon-link"></span></a>字符串字面量</h3><p>StaticScript 只支持以双引号包裹的字符串字面量, 例如<code>"hello"</code>, <code>"world"</code></p><h2 id="数组字面量"><a aria-hidden="true" href="#数组字面量"><span class="icon icon-link"></span></a>数组字面量</h2><p>StaticScript 支持一维和多维数组字面量, 例如</p><ul><li><code>[1, 2, 3, 4]</code></li><li><code>[[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]]</code></li></ul><blockquote><p>StaticScript 中的数组字面量目前只支持作为变量/常量声明的初始值使用</p></blockquote></div><div class="__dumi-default-layout-footer-meta"><span data-updated-text="最后更新时间:">2020/12/19 下午2:18:48</span></div></div></div></div>
<script>
window.g_useSSR = true;
window.g_initialProps = {};
</script>
<script src="/umi.63dc6bce.js"></script>
</body>
</html>