Skip to content

Commit c9c4922

Browse files
committed
update docs
1 parent 746afbd commit c9c4922

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

docs/uniast-en.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ To ensure precise querying and scalable storage, `ModPath?PkgPath#SymbolName` is
2020
> * In Python, a package is a directory, which may contain sub-packages. A package can also contain modules, which are .py files inside the package directory.
2121
> * In Rust, the term package does not exist at all. Instead, a crate (project) contains multiple modules, and modules may include sub-modules.
2222
> * In C, neither concept exists at all.
23-
>
23+
> * In Thrift, no concept of modules, but there are namespaces for each language.
24+
>
2425
> Do not confuse them with the terminology used in abcoder!
2526
> In abcoder, unless otherwise specified, the module (mod) and package (pkg) are defined as follows:
2627
@@ -44,6 +45,8 @@ To ensure precise querying and scalable storage, `ModPath?PkgPath#SymbolName` is
4445
- Golang: Corresponds to a package, e.g., github.com/cloudwego/hertz/pkg/app/server
4546

4647
- Rust: Corresponds to a mod, e.g., [serde_json](https://crates.io/crates/serde_json)::[value](https://docs.rs/serde_json/1.0.114/serde_json/value/index.html)
48+
- Thrift: corresponds to namespace, specifying a different idl package type results in a different namespace
49+
- Example: `go namespace test.main` -> `test.main`
4750

4851
- Note: This should be as equivalent as possible to the import (use) path in code files for easier LLM understanding
4952

docs/uniast-zh.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Universal Abstract-Syntax-Tree 是 ABCoder 建立的一种 LLM 亲和、语言
2020
> * 在 Python 中则是,package 是一个目录,可能包含子 package。而且 package 也可能包含 module,是 package 目录下的 py 文件。
2121
> * 在 Rust 中根本没有 package 的说法,而是 crate(项目)包含了诸 module。module 可能包含子 module。
2222
> * 在 C 中就完全没有这两个东西。
23+
> * 在 Thrift 中就完全没有 module 的概念, 但是有各个语言的 namespace
2324
>
2425
> 不要把它们和 abcoder 的描述混淆!
2526
> 在 abcoder 中,除非另外说明,module(mod) / package(pkg) 的含义如下。
@@ -44,6 +45,8 @@ Universal Abstract-Syntax-Tree 是 ABCoder 建立的一种 LLM 亲和、语言
4445
- Golang: 对应 package,如 github.com/cloudwego/hertz/pkg/app/server
4546

4647
- Rust: 对应 mod,如 [serde_json](https://crates.io/crates/serde_json): : [value](https://docs.rs/serde_json/1.0.114/serde_json/value/index.html)
48+
- Thrift: 对应 namespace, 指定不同的 idl Package type 会获得不同的 namespace
49+
- 例如: `go namespace test.main` -> `test.main`
4750

4851
- 提示: 这里应该尽量等同于代码文件中的 import (use) 路径,方便 LLM 理解
4952

0 commit comments

Comments
 (0)