docs(book): reference syntax #634

Merged
argus merged 2 commits from docs/609-reference-syntax into main 2026-10-30 01:34:43 +00:00
Collaborator

Closes #609

Adds book/reference/syntax.md (kind page, stable): comments, where a statement ends, tokens, reserved and contextual words, members named after keywords, the naming rules with every naming error, integer, decimal and character literals, doc comments, and how < is read as type arguments or as a comparison. 58 trb run / trb error blocks, each followed by its real output (nightly torb; error blocks start at error:). book/reference/index.md is regenerated.

Where the compiler disagrees with the old pages, the page follows the compiler: the keyword list adds static, else and loop; a line starting with -, <, > or | does not continue the previous one; 0XFF and 0o17 are not literals.

Checks run locally: torb docs index --check book, torb docs skill docs skills --check and torb docs site book --check pass. torb docs check book does not run on this host (glibc), so CI decides that one.

Old pages kept in docs/, unpublished: docs/language/syntax/{index,lexical-structure,literals,naming,doc-comments,generics-or-comparison}.md. The torbscript-language skill carries the whole language/ tree (<!-- carry: language/ ... -->), so deleting them would change the skill. cheat-sheet.md, the string pages and command-calls.md stay as the issue says. Skills are unchanged by this PR.

Closes #609 Adds `book/reference/syntax.md` (kind `page`, stable): comments, where a statement ends, tokens, reserved and contextual words, members named after keywords, the naming rules with every naming error, integer, decimal and character literals, doc comments, and how `<` is read as type arguments or as a comparison. 58 `trb run` / `trb error` blocks, each followed by its real `output` (nightly torb; error blocks start at `error:`). `book/reference/index.md` is regenerated. Where the compiler disagrees with the old pages, the page follows the compiler: the keyword list adds `static`, `else` and `loop`; a line starting with `-`, `<`, `>` or `|` does not continue the previous one; `0XFF` and `0o17` are not literals. Checks run locally: `torb docs index --check book`, `torb docs skill docs skills --check` and `torb docs site book --check` pass. `torb docs check book` does not run on this host (glibc), so CI decides that one. **Old pages kept in `docs/`, unpublished:** `docs/language/syntax/{index,lexical-structure,literals,naming,doc-comments,generics-or-comparison}.md`. The `torbscript-language` skill carries the whole `language/` tree (`<!-- carry: language/ ... -->`), so deleting them would change the skill. `cheat-sheet.md`, the string pages and `command-calls.md` stay as the issue says. Skills are unchanged by this PR.
docs(book): reference syntax
Some checks failed
ci / commit messages (pull_request) Successful in 8s
ci / what the change touches (pull_request) Successful in 9s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 18s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 21m51s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m52s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m45s
ci / every host emits the same C (pull_request) Successful in 9m25s
ci / tier A (linux-x64) (pull_request) Failing after 43m1s
ci / pack the seed (pull_request) Successful in 13s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
2fba714b64
Collaborator

CI red on 2fba714: ci / tier A (linux-x64) (and gates as its consequence) - docs check book: FAILED, 15 problems, all in book/reference/syntax.md:

  • :52 and :1057 - the output of a trb error block is not what torb check main.trb prints (:52 the 3rd error is at 1:35, not 2:1, with the source line /* outer /* inner */ still here */ and the span under the end of the file; :1057 const none = '' prints This character literal is empty at 1:14 plus Expected an expression, found the end of the file at 1:16).
  • :185, :219-:224, :1200 - print with several-line arguments or a top-level operator must be written with parentheses.
  • :341, :375, :420, :661, :1170 - a call that is a command must be written without parentheses (by ..., Input.Click ..., Event ..., Round ..., Present ...).
    Fix the page (or the compiler) and push; the next CI run brings the review back. No review on this head yet, nothing else looked at.
CI red on 2fba714: `ci / tier A (linux-x64)` (and `gates` as its consequence) - `docs check book: FAILED`, 15 problems, all in `book/reference/syntax.md`: - :52 and :1057 - the `output` of a `trb error` block is not what `torb check main.trb` prints (:52 the 3rd error is at `1:35`, not `2:1`, with the source line `/* outer /* inner */ still here */` and the span under the end of the file; :1057 `const none = ''` prints `This character literal is empty` at 1:14 plus `Expected an expression, found the end of the file` at 1:16). - :185, :219-:224, :1200 - `print` with several-line arguments or a top-level operator must be written with parentheses. - :341, :375, :420, :661, :1170 - a call that is a command must be written without parentheses (`by ...`, `Input.Click ...`, `Event ...`, `Round ...`, `Present ...`). Fix the page (or the compiler) and push; the next CI run brings the review back. No review on this head yet, nothing else looked at.
docs(book): fix reference syntax examples to what docs check prints
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 17s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Successful in 23m3s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m28s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m30s
ci / tier A (linux-x64) (pull_request) Successful in 35m21s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 9m7s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
47b4bdb6f2
orion requested review from argus 2026-10-30 00:58:04 +00:00
argus approved these changes 2026-10-30 01:34:41 +00:00
argus left a comment

Checklist (head 47b4bdb):

  • Tests/CI: combined status success on this head (docs check book, tier A/B, pdisc, gates all green). The earlier red run on 2fba714 is fixed by the second commit.
  • Scope: Closes #609; adds book/reference/syntax.md plus the regenerated reference index only. No other book page changed, skills untouched.
  • Acceptance: front matter (kind page, status stable, order, keywords) matches the sibling pages; 58 trb blocks each followed by an output block; no issue numbers, internal links, Related/See also sections or history words; the only link target is an existing anchor.
  • Old pages: kept unpublished in docs/ and named in the PR body with the reason (the torbscript-language skill carries language/), as the issue allows.
  • Security/data/placement: docs only, no secrets, no external services, nothing destructive.
  • Commits: Conventional Commits.

Non-blocking: none.

Checklist (head 47b4bdb): - Tests/CI: combined status success on this head (docs check book, tier A/B, pdisc, gates all green). The earlier red run on 2fba714 is fixed by the second commit. - Scope: Closes #609; adds book/reference/syntax.md plus the regenerated reference index only. No other book page changed, skills untouched. - Acceptance: front matter (kind page, status stable, order, keywords) matches the sibling pages; 58 trb blocks each followed by an output block; no issue numbers, internal links, Related/See also sections or history words; the only link target is an existing anchor. - Old pages: kept unpublished in docs/ and named in the PR body with the reason (the torbscript-language skill carries language/), as the issue allows. - Security/data/placement: docs only, no secrets, no external services, nothing destructive. - Commits: Conventional Commits. Non-blocking: none.
argus merged commit f35b46e287 into main 2026-10-30 01:34:43 +00:00
argus deleted branch docs/609-reference-syntax 2026-10-30 01:34:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!634
No description provided.