Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

fix: resolve broken links #30

Merged
merged 5 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blog/ecma-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ The author of jsparagus made a rant about this [here](https://github.com/mozilla
## Expressions, Statements, Functions, Classes, Scripts and Modules

It takes a while to understand the syntactic grammar, then apply them to writing a parser.
More in-depth content can be found in [the grammar tutorial](./blog/grammar).
More in-depth content can be found in [the grammar tutorial](./grammar.md).

## Annex B
3 changes: 1 addition & 2 deletions blog/rome.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This tutorial summarizes them in learning order for better understanding.

## History

- The Rome codebase was rewritten from TypeScript to Rust, see [Rome will be rewritten in Rust](https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust)
- The Rome codebase was rewritten from TypeScript to Rust, see [Rome will be rewritten in Rust](https://web.archive.org/web/20230401084626/https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust/)
- The decision was made after talking to the author of [rslint](https://github.com/rslint/rslint) and [rust-analyzer](https://github.com/rust-lang/rust-analyzer)
- rust-analyzer proved that IDE-centric tools built around concrete syntax tree are possible
- rslint proved that it is possible to write a JavaScript parser in Rust, with the same base libraries as rust-analyzer
Expand Down Expand Up @@ -59,7 +59,6 @@ https://github.com/rome/tools/blob/9815467c66688773bc1bb6ef9a5b2d86ca7b3682/crat
## Contributing

- [CONTRIBUTING.md](https://github.com/rome/tools/blob/main/CONTRIBUTING.md) has instructions on how to contribute
- [rome_js_parser crate doc](https://rome.github.io/tools/rome_js_parser/index.html) has some more details on the parser
- See [`cargo codegen test`](https://github.com/rome/tools/tree/main/xtask/codegen#cargo-codegen-test) for working with parser tests
- See [`cargo coverage`](https://github.com/rome/tools/tree/main/xtask/coverage) for working with conformance tests
- Join the [Discord Server](https://discord.com/invite/rome) for inquiries
Expand Down
2 changes: 1 addition & 1 deletion docs/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ JavaScript grammar has a lot of nuisances, read the [grammar tutorial](/blog/gra

### Memory Allocations

Back in the [Overview](./overview) chapter,
Back in the [Overview](./overview.md) chapter,
I briefly mentioned that we need to look out for heap-allocated structs such as `Vec` and `Box` because heap allocations are not cheap.

Take a look at the [real world implementation from swc](https://github.com/swc-project/swc/blob/main/crates/swc_ecma_ast/src/expr.rs),
Expand Down
2 changes: 1 addition & 1 deletion i18n/ja/docusaurus-plugin-content-blog/ecma-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ HTMLでは `<script type="module" src="main.mjs"></script>` と書きます。
## 式、文、関数、クラス、スクリプト、モジュール

構文的な文法を理解し、それをパーサーの作成に適用するには時間がかかります。
より詳細な内容は、[文法チュートリアル](./blog/grammar) で見つけることができます。
より詳細な内容は、[文法チュートリアル](./grammar.md) で見つけることができます。

## 付録B
3 changes: 1 addition & 2 deletions i18n/ja/docusaurus-plugin-content-blog/rome.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Rome は、JavaScript と TypeScript のパースに様々な技術を使用し

## 歴史

- Rome のコードベースは TypeScript から Rust に書き直されました。詳細は [Rome will be rewritten in Rust](https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust) をご覧ください。
- Rome のコードベースは TypeScript から Rust に書き直されました。詳細は [Rome will be rewritten in Rust](https://web.archive.org/web/20230401084626/https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust/) をご覧ください。
- この決定は、[rslint](https://github.com/rslint/rslint) と [rust-analyzer](https://github.com/rust-lang/rust-analyzer) の作者との話し合いの結果行われました。
- rust-analyzer は、IDE のようなツールを具象構文木をベースに構築できることを証明しました。
- rslint は、rust-analyzer で使用されているライブラリを用いて、 Rust で JavaScript のパーサーを実装できることを証明しました。
Expand Down Expand Up @@ -58,7 +58,6 @@ https://github.com/rome/tools/blob/9815467c66688773bc1bb6ef9a5b2d86ca7b3682/crat
## コントリビューション

- [CONTRIBUTING.md](https://github.com/rome/tools/blob/main/CONTRIBUTING.md) には、コントリビューションの方法の説明があります。
- [rome_js_parser crate doc](https://rome.github.io/tools/rome_js_parser/index.html) には、パーサーに関する実装の説明があります。
- パーサーのテストについては、[`cargo codegen test`](https://github.com/rome/tools/tree/main/xtask/codegen#cargo-codegen-test) をご確認ください。
- 適合テストについては、 [`cargo coverage`](https://github.com/rome/tools/tree/main/xtask/coverage) をご覧ください。
- 分からないことがあれば、[Discord サーバー](https://discord.com/invite/rome) で自由に質問できます。
Expand Down
2 changes: 1 addition & 1 deletion i18n/ja/docusaurus-plugin-content-docs/current/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ JavaScriptの文法には多くの面倒な点があります。興味深いの

### メモリ割り当て

[概要](./overview) の章で、ヒープに割り当てられた `Vec` や `Box` などの構造体に注意が必要であることを簡単に述べました。なぜなら、ヒープの割り当ては安価ではないからです。
[概要](./overview.md) の章で、ヒープに割り当てられた `Vec` や `Box` などの構造体に注意が必要であることを簡単に述べました。なぜなら、ヒープの割り当ては安価ではないからです。

[swc](https://github.com/swc-project/swc/blob/main/crates/swc_ecma_ast/src/expr.rs) の実装を見てみると、ASTには多くの `Box` や `Vec` が含まれていることがわかります。また、`Statement` と `Expression` の列挙型には多数の列挙子が含まれていることにも注意してください。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: 参考文献

- Rust
- [swc](https://swc.rs)
- [Rome](https://rome.tools)
- [Biome](https://biomejs.dev)
- [jsparagus](https://github.com/mozilla-spidermonkey/jsparagus)
- [ratel](https://github.com/ratel-rust/ratel-core)
- [boa](https://github.com/lastmjs/boa-azle)
Expand Down
6 changes: 3 additions & 3 deletions i18n/ko/docusaurus-plugin-content-blog/conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Test262 목표는, 사양 지정된 모든 측정 가능한 동작을 커버하
## Babel

JavaScript에 새로운 언어 기능이 추가되면, Babel 에서도 이를 해석할 필요가 있습니다.
이에, Babel에는 독자적[파서 테스트](https://github.com/babel/babel/tree/main/packages/babel-parser/test)가 있습니다.
이에, Babel에는 독자적 [파서 테스트](https://github.com/babel/babel/tree/main/packages/babel-parser/test)가 있습니다.

## TypeScript

TypeScript 적합성 테스트는 [이 곳](https://github.com/microsoft/TypeScript/tree/main/tests/cases/conformance)에서 확인할 수 있습니다.
TypeScript 적합성 테스트는 [이곳](https://github.com/microsoft/TypeScript/tree/main/tests/cases/conformance)에서 확인할 수 있습니다.

## Test Runner

Rome는 상기한 테스트 스위트 용으로 테스트 러너를 구현해두었으며, [여기서](https://github.com/rome/tools/tree/main/xtask/coverage) 확인 가능합니다.
Rome는 상기한 테스트 스위트 용으로 테스트 러너를 구현해두었으며, [여기서](https://github.com/rome/tools/tree/main/xtask/coverage) 확인 가능합니다.
2 changes: 1 addition & 1 deletion i18n/ko/docusaurus-plugin-content-blog/ecma-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ jsparagus는 이에 대해 [언급](https://github.com/mozilla-spidermonkey/jspa
## Expressions, Statements, Functions, Classes, Scripts and Modules(표현식, 문법, 함수, 클래스, 스크립트와 모듈)

구문 문법을 이해한 다음 구문 분석기를 작성하는 데 적용하려면 시간이 필요합니다.
보다 심층적 내용은 More in-depth content can be found in [문법 튜토리얼](./blog/grammar)에서 확인해주세요.
보다 심층적 내용은 More in-depth content can be found in [문법 튜토리얼](./grammar.md)에서 확인해주세요.

## Annex B
3 changes: 1 addition & 2 deletions i18n/ko/docusaurus-plugin-content-blog/rome.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Rome은, JavaScript와 TypeScript 파서의 여러 기술을 사용합니다.

## 역사

- Rome 코드 기반은 TypeScript에서 Rust로 재작성되었습니다. 상세한 내용은 [Rome will be rewritten in Rust](https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust) 를 통해 확인 가능합니다.
- Rome 코드 기반은 TypeScript에서 Rust로 재작성되었습니다. 상세한 내용은 [Rome will be rewritten in Rust](https://web.archive.org/web/20230401084626/https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust/) 를 통해 확인 가능합니다.
- 이 결정은, [rslint](https://github.com/rslint/rslint)와 [rust-analyzer](https://github.com/rust-lang/rust-analyzer) 저자와 대화 후의 결과입니다.
- rust-analyzer는, IDE 같은 도구를 추상 구문 트리 기반으로 구축하다는 것을 증명했습니다.
- rslint는, rust-analyzer에 사용되어 있던 라이브러리를 사용해, Rust에서 JavaScript 파서를 구현 가능하다는 것을 증명했습니다.
Expand Down Expand Up @@ -58,7 +58,6 @@ https://github.com/rome/tools/blob/9815467c66688773bc1bb6ef9a5b2d86ca7b3682/crat
## 공헌

- [CONTRIBUTING.md](https://github.com/rome/tools/blob/main/CONTRIBUTING.md)에는, 공헌 방법에 대해 설명되어 있습니다.
- [rome_js_parser crate doc](https://rome.github.io/tools/rome_js_parser/index.html) 에는, 파서와 관련된 구현 설명이 있습니다.
- 파서 테스트에 대해서는, [`cargo codegen test`](https://github.com/rome/tools/tree/main/xtask/codegen#cargo-codegen-test) 확인해주세요.
- 적합 테스트에 관해서는, [`cargo coverage`](https://github.com/rome/tools/tree/main/xtask/coverage) 확인해주세요.
- 잘 모르는 부분이 있다면, [Discord 서버](https://discord.com/invite/rome) 에서 자유로히 질문 가능합니다.
Expand Down
2 changes: 1 addition & 1 deletion i18n/ko/docusaurus-plugin-content-docs/current/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Rust에서는 self-referential struct가 허용되지 않기 때문에 `Box`가

### Memory Allocations

[Overview](./overview) 장으로 돌아갑니다,
[Overview](./overview.md) 장으로 돌아갑니다,
힙 할당 비용이 저렴하지 않기 때문에 `Vec`, `Box`와 같은 힙 할당 구조체를 주의해야 한다고 간략하게 언급했습니다.

[swc의 실제 구현](https://github.com/swc-project/swc/blob/main/crates/swc_ecma_ast/src/expr.rs)을 살펴보세요,
Expand Down
2 changes: 1 addition & 1 deletion i18n/zh/docusaurus-plugin-content-blog/ecma-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ The author of jsparagus made a rant about this [here](https://github.com/mozilla
## Expressions, Statements, Functions, Classes, Scripts and Modules

It takes a while to understand the syntactic grammar, then apply them to writing a parser.
More in-depth content can be found in [the grammar tutorial](./blog/grammar).
More in-depth content can be found in [the grammar tutorial](./grammar.md).

## Annex B
3 changes: 1 addition & 2 deletions i18n/zh/docusaurus-plugin-content-blog/rome.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This tutorial summarizes them in learning order for better understanding.

## History

- The Rome codebase was rewritten from TypeScript to Rust, see [Rome will be rewritten in Rust](https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust)
- The Rome codebase was rewritten from TypeScript to Rust, see [Rome will be rewritten in Rust](https://web.archive.org/web/20230401084626/https://rome.tools/blog/2021/09/21/rome-will-be-rewritten-in-rust/)
- The decision was made after talking to the author of [rslint](https://github.com/rslint/rslint) and [rust-analyzer](https://github.com/rust-lang/rust-analyzer)
- rust-analyzer proved that IDE-centric tools built around concrete syntax tree are possible
- rslint proved that it is possible to write a JavaScript parser in Rust, with the same base libraries as rust-analyzer
Expand Down Expand Up @@ -59,7 +59,6 @@ https://github.com/rome/tools/blob/9815467c66688773bc1bb6ef9a5b2d86ca7b3682/crat
## Contributing

- [CONTRIBUTING.md](https://github.com/rome/tools/blob/main/CONTRIBUTING.md) has instructions on how to contribute
- [rome_js_parser crate doc](https://rome.github.io/tools/rome_js_parser/index.html) has some more details on the parser
- See [`cargo codegen test`](https://github.com/rome/tools/tree/main/xtask/codegen#cargo-codegen-test) for working with parser tests
- See [`cargo coverage`](https://github.com/rome/tools/tree/main/xtask/coverage) for working with conformance tests
- Join the [Discord Server](https://discord.com/invite/rome) for inquiries
Expand Down
2 changes: 1 addition & 1 deletion i18n/zh/docusaurus-plugin-content-docs/current/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ JavaScript语法有很多细微而玄妙之处,请阅读[语法教程](/blog/g

### 内存分配

在[概述](./overview)章节中提到,我们需要额外注意分配在堆上的结构体,如`Vec`和`Box`。这是因为堆分配并不廉价。
在[概述](./overview.md)章节中提到,我们需要额外注意分配在堆上的结构体,如`Vec`和`Box`。这是因为堆分配并不廉价。

看一下[来自 swc 项目的真实实现](https://github.com/swc-project/swc/blob/main/crates/swc_ecma_ast/src/expr.rs),我们可以看到AST可能有很多`Box`和`Vec`,还要注意`Statement`和`Expression`枚举包含很多枚举变体。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Block : { StatementList }

我们需要添加一个作用域树 (scope tree)。作用域树包含在其中声明的所有`var`和`let`。
这棵树的节点有指向父级节点的指针,我们希望以此在树上向上移动并在父级作用域之中搜索绑定标识符。
我们可以使用`indextree`作为数据结构(https://docs.rs/indextree/latest/indextree/
我们可以使用[`indextree`](https://docs.rs/indextree/latest/indextree/)作为数据结构

```rust
use indextree::{Arena, Node, NodeId};
Expand Down