Racket 的 Shrubbery 语法

Lobsters Hottest 工具

摘要

Shrubbery 表示法是一种对行和缩进敏感的文本级表示法,用于 Racket 中的 Rhombus 编程语言,旨在部分地对输入进行分组以供进一步解析。

<p><a href="https://lobste.rs/s/dlmkdx/shrubbery_syntax_for_racket">评论</a></p>
查看原文
查看缓存全文

缓存时间: 2026/06/11 13:38

# 灌木丛记法(Shrubbery Notation) 来源:https://docs.racket-lang.org/shrubbery/index.html 0\.46\+9\.2 Rhombus 顶部 (https://docs.racket-lang.org/index.html)目录← 上一页 (https://docs.racket-lang.org/index.html)下一页 → (https://docs.racket-lang.org/shrubbery/example.html) 灌木丛记法是一套文本级别的约定,旨在逐步构建像Rhombus (https://download.racket-lang.org/releases/9.2/doc/local-redirect/index.html?doc=rhombus&rel=index.html&version=9.2) 这样的完整编程语言。该记法对换行和缩进敏感,旨在对输入进行部分分组,但将进一步的解析留给另一层,特别是enforestation (https://download.racket-lang.org/releases/9.2/doc/local-redirect/index.html?doc=enforest&rel=index.html&version=9.2)。灌木丛的解析形式会施加分组,以确保进一步的解析与灌木丛的换行和缩进一致。 1快速概览 (https://docs.racket-lang.org/shrubbery/example.html) 1\.1简单项 (https://docs.racket-lang.org/shrubbery/example.html#%28part._.Simple_.Terms%29) 1\.2注释 (https://docs.racket-lang.org/shrubbery/example.html#%28part._.Comments%29) 1\.3换行与缩进 (https://docs.racket-lang.org/shrubbery/example.html#%28part._.Lines_and_.Indentation%29) 1\.4圆括号、方括号、花括号与引号 (https://docs.racket-lang.org/shrubbery/example.html#%28part._.Parentheses__.Brackets__.Braces__and_.Quotes%29) 1\.5S-表达式互操作性 (https://docs.racket-lang.org/shrubbery/example.html#%28part._.S-.Expression_.Interoperability%29) 2灌木丛规范 (https://docs.racket-lang.org/shrubbery/spec.html) 2\.1组与块 (https://docs.racket-lang.org/shrubbery/group-and-block.html) 2\.1\.1按行分组 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._.Grouping_by_.Lines%29) 2\.1\.2按开闭符对分组 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._.Grouping_by_.Opener--.Closer_.Pairs%29) 2\.1\.3使用`:`与缩进创建块 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._.Blocking_with___and_.Indentation%29) 2\.1\.4使用缩进与运算符延续 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._continuing-op%29) 2\.1\.5使用`|`表示备选 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._alts%29) 2\.1\.6使用`;`和`,`分隔组 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._semicolon%29) 2\.1\.7使用`«`与`»`忽略换行与列 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._guillemet%29) 2\.1\.8使用`\`延续一行 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._continuing-backslash%29) 2\.1\.9使用`#//`进行组注释 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._group-comment%29) 2\.1\.10使用`@`的at-记法 (https://docs.racket-lang.org/shrubbery/group-and-block.html#%28part._at-notation%29) 2\.2词法单元解析 (https://docs.racket-lang.org/shrubbery/token-parsing.html) 2\.3At-记法解析 (https://docs.racket-lang.org/shrubbery/at-parsing.html) 3解析表示 (https://docs.racket-lang.org/shrubbery/parsed-rep.html) 4灌木丛语言 (https://docs.racket-lang.org/shrubbery/language.html) 5灌木丛API (https://docs.racket-lang.org/shrubbery/Shrubbery_APIs.html) 5\.1解析 (https://docs.racket-lang.org/shrubbery/parse.html) 5\.2源位置与原始文本属性 (https://docs.racket-lang.org/shrubbery/raw-text.html) 5\.3重建灌木丛记法 (https://docs.racket-lang.org/shrubbery/print.html) 5\.4书写灌木丛记法 (https://docs.racket-lang.org/shrubbery/write.html) 5\.5工具支持 (https://docs.racket-lang.org/shrubbery/tool.html) 5\.5\.1语言配置 (https://docs.racket-lang.org/shrubbery/tool.html#%28part._.Language_.Configuration%29) 5\.5\.2语法着色 (https://docs.racket-lang.org/shrubbery/tool.html#%28part._.Syntax_.Coloring%29) 5\.5\.3缩进 (https://docs.racket-lang.org/shrubbery/tool.html#%28part._.Indentation%29) 5\.5\.4项与组导航 (https://docs.racket-lang.org/shrubbery/tool.html#%28part._.Term_and_.Group_.Navigation%29) 5\.5\.5击键 (https://docs.racket-lang.org/shrubbery/tool.html#%28part._.Keystrokes%29) 5\.6灌木丛变体 (https://docs.racket-lang.org/shrubbery/variant.html) 6设计考量 (https://docs.racket-lang.org/shrubbery/Design_Considerations.html) 6\.1基本原理 (https://docs.racket-lang.org/shrubbery/Design_Considerations.html#%28part._.Rationale%29) 6\.2既有成果 (https://docs.racket-lang.org/shrubbery/Design_Considerations.html#%28part._.Prior_.Art%29) 7编辑器支持 (https://docs.racket-lang.org/shrubbery/tool-support.html) 7\.1DrRacket中的灌木丛支持 (https://docs.racket-lang.org/shrubbery/tool-support.html#%28part._drracket-shrubbery%29) 7\.2如何输入`«...»` (https://docs.racket-lang.org/shrubbery/tool-support.html#%28part._type-guillemet%29) 顶部 (https://docs.racket-lang.org/index.html)目录← 上一页 (https://docs.racket-lang.org/index.html)下一页 → (https://docs.racket-lang.org/shrubbery/example.html)

相似文章

Rubish: 一个纯 Ruby 编写的 Unix 外壳

Hacker News Top

Rubish 是一个纯 Ruby 编写的 Unix 外壳,旨在实现与 bash 的完全兼容,同时深度整合 Ruby 的特性,如块、迭代器和方法链。

Show HN: Nibble

Hacker News Top

Nibble 是一种类 C 的系统编程语言,用 3000 行 C 代码实现,无需外部依赖或堆分配即可生成 LLVM IR。它支持 defer、递归、多种类型、结构体、指针,并包含图形演示。