Commit Graph

13 Commits

Author SHA1 Message Date
Timothy Sample 878b9c3dca Add support for Guile 2.0.9.
* gash/compat.scm: New file.
* gash/compat/hash-table.scm: New file.
* Makefile.am: Add them.
* .dir-locals.scm: Add indentation for 'if-guile-version-below'.
* guix.scm (guile-2.0.9): New variable.
* gash/built-ins/echo.scm (escape->control): Use '#\esc'.
* gash/environment.scm: Use '(gash compat hash-table)'.
* gash/built-ins/break.scm,
gash/built-ins/cd.scm,
gash/built-ins/command.scm,
gash/built-ins/continue.scm,
gash/built-ins/dot.scm,
gash/built-ins/exec.scm,
gash/built-ins/exit.scm,
gash/built-ins/pwd.scm,
gash/built-ins/return.scm,
gash/built-ins/set.scm,
gash/built-ins/shift.scm,
gash/built-ins/trap.scm,
gash/built-ins/type.scm,
gash/built-ins/umask.scm,
gash/eval.scm,
tests/unit/automake.scm: Use '(gash compat)'.

squash! Add support for Guile 2.0.9.
2019-05-20 18:07:47 -04:00
Timothy Sample 28093b843e Clean up '.dir-locals.el'.
* .dir-locals.el: Change indentation, and make sure that tabs are used
when editing Makefiles.
2019-05-20 01:18:54 -04:00
Timothy Sample 23e53f4e49 Merge branch 'gash'
This commit brings in the entire history of the Gash project.  There
are a few conflicts, which are explained below.

* .dir-locals.el: Combine both files.
* .gitignore: Combine both files.
* COPYING: Use the Geesh version with HTTPS URLs.
* README: Use the Gash README.
* guix.scm: Use the Geesh package definition (the Gash one is
preserved in gash.guix.scm).
2018-12-13 13:42:21 -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 58f5644d2a Add 'arguments' field to environment
* geesh/environment.scm (<environment>): Add an 'arguments' field.
(make-environment): Add an optional 'arguments' parameter.
(with-environment-arguments): New public function.
.dir-locals.el: Indent it nicely.
2018-12-03 20:19:22 -05:00
Timothy Sample db56b1cc0a Add for-loop semantics
* geesh/shell.scm (sh:for): New public function.
* .dir-locals.el: Indent it nicely.
2018-12-03 20:12:51 -05:00
Timothy Sample 6b6ca11bce Add command substitution semantics
* geesh/shell.scm (%subshell): New function factored out from 'subshell'.
(subshell): Use it.
(substitute-command): New public function.
* tests/shell.scm: Test it.
* .dir-locals.el: Indent it nicely.
2018-12-03 20:06:47 -05:00
Timothy Sample 8739cafad9 Add subshell semantics
* geesh/shell.scm (subshell): New public function.
* tests/shell.scm: Test it.
* .dir-locals.el: Indent it nicely.
2018-11-28 23:07:03 -05:00
Timothy Sample e6f732ada9 Add redirect semantics
* geesh/shell.scm (save-and-install-redirect!): New function.
(restore-saved-fdes!): New function.
(with-redirects): New public function.
* tests/shell.scm: Test it.
* .dir-locals.el: Indent it nicely.
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 ff14ea0097 Rename '<sh-define>' to '<sh-defun>' and simplify
This change is already in the syntax document.

* geesh/parser.scm (make-parser): Rename '<sh-define>' to '<sh-defun>'
and use the function name directly instead of making it a singleton
list.
* tests/parser.scm: Update tests.
* .dir-locals.el: Update indentation.
2018-11-02 14:35:34 -04:00
Jan Nieuwenhuizen 41f723c417 Geiser support.
* .dir-locals.el: Geiser support.
2018-07-04 20:11:26 +02: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