- (bjosh syntax): a part of POSIX sh, parsed with (text parser-combinators). Syntax that is not supported raises an error that names it. - (bjosh expand): variables, ~ and globs. Values are not split. - (bjosh exec): pipes as (std run) jobs, && || ; &, redirections, and NAME=value through env. - (bjosh shell) and (bjosh builtins): the job table and cd, pwd, exit, export, unset, jobs, fg, bg, kill, type, help, history. - (bjosh editor): Enter waits for open quotes and trailing operators; completion of commands and files. - -c LINE, FILE, and stdin. A Native AOT build too. - Tests: the parser, expansion, the editor, lines through -c, and job control under script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
bjosh
A shell in Bjolang. The design and the phases are in plan.org.
Comments
Write clear, direct engineering comments, as in the Bjolang repo's CLAUDE.md: "returns" and "raises", contracts and invariants, bullets for non-trivial functions. No essays.
This package
bjo buildbuilds the shell:src/main.exe, and the nativesrc/main((aot #t)).bjo testruns the tests.tests/run.bjoandtests/interactive.bjorunsrc/main.exe, so runbjo buildfirst.- It depends on bjoterm at
../bjoterm. A change there needsbjo buildhere. - Modules:
(bjosh syntax): the parser, with(text parser-combinators).(bjosh expand): variables,~and globs.(bjosh shell): the state, variables and the job table.(bjosh builtins): the shell commands.(bjosh exec): lines to(std run)forms and jobs.(bjosh editor): when Enter runs a line, and the completer.
- Tests:
tests/syntax.bjo,tests/expand.bjo,tests/editor.bjo: unit tests.tests/run.bjo: lines throughbjosh -c, a file, and stdin.tests/interactive.bjo: job control and the prompt underscript.