Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugin-handbook.md #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions translations/zh-Hans/plugin-handbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Babel 是 JavaScript 编译器,更确切地说是源码到源码的编译器

这个处理过程中的每一步都涉及到创建或是操作[抽象语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree),亦称 AST。

> Babel 使用一个基于 [ESTree](https://github.com/estree/estree) 并修改过的 AST,它的内核说明文档可以在[这里](https://github. com/babel/babel/blob/master/doc/ast/spec. md)找到。.
> Babel 使用一个基于 [ESTree](https://github.com/estree/estree) 并修改过的 AST,它的内核说明文档可以在[这里](https://github.com/babel/babel/blob/master/doc/ast/spec.md)找到。

```js
function square(n) {
Expand Down Expand Up @@ -225,15 +225,15 @@ Babel 还为每个节点额外生成了一些属性,用于描述该节点在

## <a id="toc-stages-of-babel"></a>Babel 的处理步骤

Babel 的三个主要处理步骤分别是: **解析(parse)**,**转换(transform)**,**生成(generate)**。.
Babel 的三个主要处理步骤分别是: **解析(parse)**,**转换(transform)**,**生成(generate)**。

### <a id="toc-parse"></a>解析

**解析**步骤接收代码并输出 AST。 这个步骤分为两个阶段:[**词法分析(Lexical Analysis) **](https://en.wikipedia.org/wiki/Lexical_analysis)和 [**语法分析(Syntactic Analysis)**](https://en.wikipedia.org/wiki/Parsing)。.
**解析**步骤接收代码并输出 AST。 这个步骤分为两个阶段:[**词法分析(Lexical Analysis)**](https://en.wikipedia.org/wiki/Lexical_analysis)和 [**语法分析(Syntactic Analysis)**](https://en.wikipedia.org/wiki/Parsing)。

#### <a id="toc-lexical-analysis"></a>词法分析

词法分析阶段把字符串形式的代码转换为 **令牌(tokens)** 流。.
词法分析阶段把字符串形式的代码转换为 **令牌(tokens)** 流。

你可以把令牌看作是一个扁平的语法片段数组:

Expand Down Expand Up @@ -2158,4 +2158,4 @@ pluginTester({

* * *

> ***对于将来的更新,请跟随 @thejameskyle </>和 @babeljs </> 的Twitter。</em></strong></p> </blockquote>
> ***对于将来的更新,请跟随 @thejameskyle </>和 @babeljs </> 的Twitter。</em></strong></p> </blockquote>