渲染zh-Hans

The language corpus

Faber 语言语料库是公开的语言词典:每个关键字、运算符组或语言类型表面各占一个顶级目录。它是 faber explain 的开发来源,也是多目标编译矩阵的主要输入。

统计#

  • 292 个 .fab 示例文件
  • index.toml 中有 174 个注册条目
  • 约 135 个关键字和概念目录

布局#

corpus/
  函数/           # function keyword exemplars
  类/             # record type exemplars
  如果/                # conditional branch exemplars
  遍历/             # iteration exemplars
  列表/ 映射/     # collection type exemplars
  张量/ 稀疏/    # 张量 exemplars
  调用/                # capability call exemplars
  operatores/        # glyph / operator groups
  ...
  index.toml         # generated explain manifest

文件格式#

每个 .fab 文件以 TOML frontmatter 开头,用于描述该条目:

+++
term = "functio"
kind = "keyword"
category = "function"
canonical = true
summary = "Declares a named function or method."
syntax = "functio <name>(<params>) [modifiers] [→ <type>] [⇥ <error-type>] <block>"
aliases = ["function"]
related = ["→", "⇥", "redde", "sponte"]
+++

函数 saluta() {
    显示 "Salve, Mundus!"
}

用法#

faber explain 函数       # show keyword reference
faber explain ≡             # show glyph reference
faber explain --search query # search across corpus
faber explain --list         # list all terms

类别#

条目按类别组织:function、control-flow、type、collection、transfer、annotation、iteration、destructuring、testing、命令行、concept、operator-group、existing-home。