Commit Graph

40 Commits

Author SHA1 Message Date
Timothy Sample 1bd92e2893 Remove (almost) all references to Geesh.
gash/environment.scm: Remove file.
geesh/*: Move these files into the 'gash' folder and replace all
instances of the word 'geesh'.
scripts/geesh.in: Remove file.
HACKING, INSTALL, Makefile.am, configure.ac, guix.scm,
tests/bootstrap/bash-without-bash.scm, tests/spec/Makefile.am,
tests/spec/check-spec, tests/spec/oil.scm, tests/unit/*,
tools/coverage.in: Replace all instances of the word 'geesh'.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2019-05-20 01:17:40 -04:00
Jan Nieuwenhuizen 7fcfe66407 Add the 'command' built-in.
* geesh/built-ins/command.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Add 'command'.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:30 -04:00
Jan Nieuwenhuizen 57e8e3bd64 Add the 'type' built-in.
* geesh/built-ins/type.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Add 'type'.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:22 -04:00
Jan Nieuwenhuizen cf5611f6d4 Replace geesh script with gash.
* geesh/repl.scm (run-repl): Add optional parse? parameter.
* gash/gash.scm (main): Rewrite to use Geesh parser and evaluator.
* scripts/geesh.in: Remove.
* Makefile.am: Remove scripts/geesh; adjust XFAIL_TESTS.
* .gitignore: Update.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:14 -04:00
Timothy Sample 171796317f Remove external commands.
* gash/bournish-commands.scm, gash/commands/*, gash/compress.scm,
gash/guix-utils.scm, gash/lzw.scm, gash/ustar.scm: Delete files.
* gash/builtins.scm, gash/gash.scm, gash/script.scm: Remove references
to deleted modules.
* tests/100-basename-*, tests/100-dirname-*, tests/100-sed-*,
tests/100-tar-*, tests/100-tr-*: Delete files.
* Makefile.am: Remove deleted modules and tests.
2019-05-16 10:49:38 -04:00
Timothy Sample 42f9fb2671 Stabilize test suite.
* test.sh: Increase test timeout from 1 to 10.
* Makefile.am (FULL_TESTS): Move tests/10-if-redirect.sh,
tests/50-redirect-space.sh, tests/50-redirect-sed.sh, and
tests/100-cd.sh from here...
(BROKEN_TESTS): ...to here.
2019-05-16 10:49:38 -04:00
Timothy Sample 117a33d18e Use Automake to run Gash tests.
* Makefile.am: Add Gash tests and use test.sh as the log compiler.
* test.sh: Use TEST_SHELL instead of SHELL to parameterize which shell
is being tested.
* tests/06-command-compound-word.sh: Adjust this test so that it works
even if the srcdir variable is set.
* .gitignore: Add tests/*.trs
2019-05-16 10:49:38 -04:00
Timothy Sample 7e8caba055 Build Gash with Autotools.
This commit allows most of Gash to be built with Autotools.  It also
removes some of the Gash build scripts.

* configure.ac: Add checks for compress, gzip, bzip2, and xz;
configure gash/config.scm.
* Makefile.am: Add Gash modules and the 'gash' script.
* scripts/gash.in: Rename 'guile_site_dir' to 'MODDIR' and
'guile_site_ccache_dir' to 'GODIR'.
* configure: Delete file.
* makefile: Delete file.
* build-aux/build-guile.sh: Delete file.
* build-aux/pre-inst-env.in: Delete file.
* build-aux/trace.sh: Delete file.
* .gitignore: Add configure; remove exceptions for the deleted
build-aux files.
2019-05-16 10:49:16 -04:00
Timothy Sample 110167674e Reorganize tests
* tests/bash-without-bash.scm: Move this...
* tests/bootstrap/bash-without-bash.scm: ...here.
* tests/*.scm*: Move these...
* tests/unit: ...into this directory.
* configure.ac: Update paths.
* Makefile.am: Ditto.
* .gitignore: Ditto.
2018-12-12 14:23:09 -05:00
Timothy Sample 15ae84bc58 Add test for bootstrapping Bash
* tests/bash-without-bash.scm: New file.
* Makefile.am (check-bootstrap): New target.
2018-12-05 22:21:30 -05:00
Timothy Sample acaaa3c322 Use git-version-gen for versioning
* build-aux/git-version-gen: New file.
* .gitignore: Do not ignore it.
* configure.ac: Use it to generate the version string.
* guix.scm: Ditto.
* Makefile.am: Make .tarball-version.
2018-12-05 22:17:41 -05:00
Timothy Sample 9fd1eb9edf Set search paths explicitly in the geesh script
* configure.ac: Do not treat scripts/geesh as an AC_CONFIG_FILE.
* Makefile.am: Do the substitutions here (at make-time).
* scripts/geesh.in: Update %load-path and %load-compiled-path
explicitly before loading anything.
2018-12-05 16:08:09 -05:00
Timothy Sample 79e5c6eafc Add the trap built-in
* geesh/built-ins/trap.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*special-built-ins*): Add trap.
2018-12-05 16:08:09 -05:00
Timothy Sample 3769dce584 Add the return and exit built-ins
* geesh/built-ins/return.scm: New file.
* geesh/built-ins/exit.scm: New file.
* geesh/Makefile.am: Add them.
* geesh/built-ins.scm (*special-built-ins*): Add return and exit.
2018-12-05 16:08:09 -05:00
Timothy Sample 2543ecd2bb Add the exec built-in
* geesh/built-ins/exec.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*special-built-ins*): Add exec.
2018-12-05 16:08:09 -05:00
Timothy Sample bacbb43650 Add the umask built-in
* geesh/built-ins/umask.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Add umask.
2018-12-05 16:08:09 -05:00
Timothy Sample a7c5d8cceb Add the shift built-in
* geesh/built-ins/shift.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*special-built-ins*): Add shift.
2018-12-05 16:08:09 -05:00
Timothy Sample c1f8a870ed Add the dot and eval built-ins
* geesh/built-ins/utils.scm (get-evaluator): New public function.
* geesh/built-ins/dot.scm: New file.
* geesh/built-ins/eval.scm: New file.
* geesh/Makefile.am: Add them.
* geesh/built-ins.scm (*special-built-ins*): Add dot and eval.
2018-12-05 16:08:09 -05:00
Timothy Sample 2c1dd2d67e Add the colon built-in
* geesh/built-ins/colon.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*special-built-ins*): Add colon.
2018-12-05 16:08:09 -05:00
Timothy Sample 271301e77d Add the cd and pwd built-ins
* geesh/built-ins/cd.scm: New file.
* geesh/built-ins/pwd.scm: New file.
* Makefile.am: Add them.
* geesh/built-ins.scm (*built-ins*): Add cd and pwd.
2018-12-05 16:08:09 -05:00
Timothy Sample 4ef6907851 Globalize the environment module
Instead of passing around references to the environment, just treat it
as a global.  The old way was just the remains of an idea to make the
environment immutable and keep the interpreter from manipulating any
global state.  By making everything global and mutable, we will have
less impedance mismatch with POSIX going forward.

The following changelog is only a sketch, since nearly every function
has changed.

* geesh/environment.scm: Replace this module with one that treats the
environment as a global resource.
* tests/environment.scm: Delete file.
* Makefile.am: Remove it from the list of tests.
* geesh/shell.scm, geesh/eval.scm, geesh/repl.scm, geesh/word.scm,
geesh/built-ins/break.scm, geesh/built-ins/continue.scm,
geesh/built-ins/echo.scm, geesh/built-ins/export.scm,
geesh/built-ins/false.scm, geesh/built-ins/read.scm,
geesh/built-ins/readonly.scm, geesh/built-ins/set.scm,
geesh/built-ins/true.scm, geesh/built-ins/unset.scm: Remove 'env'
parameters and use the new environment module.
* .dir-locals.el: Update indentation of functions that no longer take
an 'env' parameter and add with-arguments, with-environ, and
with-variables from the new environment module.
* tests/shell.scm, tests/word.scm: Update environment creation and
manipulation in tests.
2018-12-05 16:08:09 -05:00
Timothy Sample 0d41cec2d6 Add the set built-in
* geesh/environment.scm: Export set-environment-arguments!.
* geesh/built-ins/set.scm: New file.
* Makefile.am: Add them.
* geesh/built-ins.scm: Add set.
2018-12-05 16:08:09 -05:00
Timothy Sample 671a926011 Add readonly built-in
* geesh/built-ins/utils.scm: New file.
* geesh/built-ins/readonly.scm: New file.
* Makefile.am: Add them.
* geesh/built-ins/export.scm (split-assignments): Move to utils.
* geesh/built-ins.scm (*special-built-ins*): Add readonly.
2018-12-05 16:08:09 -05:00
Timothy Sample 279ef0cd35 Add the export built-in
* geesh/built-ins/export.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*special-built-ins*): Add export.
2018-12-05 16:08:09 -05:00
Timothy Sample d4bb8ae438 Add 'true' built-in
* geesh/built-ins/true.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Add true.
2018-12-05 16:08:09 -05:00
Timothy Sample 06db42088a Add 'break' and 'continue'
* geesh/environment.scm (<environment>): Add 'break-prompt' and
'continue-prompt' fields.
(make-environment): Initialize them.
* geesh/shell.scm (sh:for): Setup break and continue prompts.
* geesh/built-ins/break.scm: New file.
* geesh/built-ins/continue.scm: New file.
* Makefile.am: Add them.
* geesh/built-ins.scm (*special-built-ins*): Add break and continue.
2018-12-05 16:08:09 -05:00
Timothy Sample e1ab2ccd94 Add pattern module
* geesh/pattern.scm: New file.
* tests/pattern.scm: New file.
* Makefile.am: Add them.
2018-12-05 16:08:09 -05:00
Timothy Sample 7e3bbda4cb Add 'unset' built-in
* geesh/environment.scm (delete-environment-vars!): New public function.
(delete-environment-functions!): New public function.
* geesh/built-ins/unset.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm: Enable 'unset'.
2018-12-05 16:08:09 -05:00
Timothy Sample f84b6235db Add Oil shell specification tests
tests/spec/oil.scm: New file.
tests/spec/check-spec: New file.
tests/spec/Makefile.am: New file.
configure.ac: Add the new Makefile.
Makefile.am (check-spec): New rule for running Oil shell
specification tests.
(clean-local): New rule that tells Automake how to clean up the
specification tests.
.gitignore: Add tests/spec/oil and tests/spec/oil-link.
2018-12-05 16:06:14 -05:00
Timothy Sample 21b862d326 Add the 'false' utility
* geesh/built-ins/false.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Define 'false'.
2018-12-03 20:15:19 -05:00
Timothy Sample 339f59d639 Add the 'read' utility
* geesh/built-ins/read.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Define 'read'.
2018-12-03 20:14:36 -05:00
Timothy Sample 549d1e7867 Remove REPL unit tests
In order to test the REPL in isolation, we would have to mock out the
parser and interpreter.  This is possible, but too much work for the
benefit (at least for now).

* tests/repl.scm: Deleted.
* Makefile.am: Remove it.
2018-11-28 23:07:03 -05:00
Timothy Sample 83c5d603ee Add eval module
* geesh/eval.scm: New file.
* Makefile.am: Add it.
2018-11-28 23:07:03 -05:00
Timothy Sample e1f139b841 Add support for built-ins, starting with 'echo'
* geesh/built-ins/echo.scm: New file.
* geesh/built-ins.scm: New file.
* Makefile.scm: Add them.
* geesh/shell.scm (exec-let): Include built-ins in command search.
* tests/shell.scm: Add a test for this.
2018-11-28 23:07:03 -05:00
Timothy Sample b9ec924bbe Add shell module
* geesh/shell.scm: New file.
* tests/shell.scm: New file.
* Makefile.am: Add them.
* tests/config.scm.in: New file.
* configure.ac: Add it.
* .gitignore: Add its generated form.
* .dir-locals.el: Add indentation rule for 'make-script'.
2018-11-28 23:07:03 -05:00
Timothy Sample a5773e90eb Add word
* geesh/word.scm: New file.
* tests/word.scm: New file.
* Makefile.am: Add them.
2018-07-15 19:46:14 -04:00
Timothy Sample 6678ae1e59 Add environment
* geesh/environment.scm: New file.
* tests/environment.scm: New file.
* Makefile.am: Add them.
2018-07-15 19:46:14 -04:00
Timothy Sample 69c3f9e6ad Add parser
* geesh/parser.scm: New file.
* tests/parser.scm: New file.
* Makefile.am: Add them.
* .dir-locals.el: New file. Include indenting rules for Shell AST
forms and 'call-with-backquoted-input-port'.
2018-02-01 00:14:12 -05:00
Timothy Sample 95181a98b5 Add lexer
* geesh/lexer.scm: New file.
* tests/lexer.scm: New file.
* Makefile.am: Add them.
2018-01-31 15:09:51 -05:00
Timothy Sample cdded95d88 Initial commit 2018-01-31 14:52:05 -05:00