Commit Graph

471 Commits

Author SHA1 Message Date
Rutger van Beusekom aa8aa10151 fix 05-assignment-doublequoted-doubleqoutes.sh 2018-11-14 19:31:29 +01:00
Rutger van Beusekom da105e0e81 fix 05-assignment-empty.sh 2018-11-14 19:31:00 +01:00
Rutger van Beusekom 6e88ad23d0 place assignment at the proper grammar level 2018-11-14 08:22:12 +01:00
Rutger van Beusekom 98868392c8 cleanup commented out code 2018-11-14 08:22:00 +01:00
Rutger van Beusekom d667922bbd narrow escape 2018-11-13 09:04:56 +01:00
Rutger van Beusekom 983b9b355a pass make check-parse 2018-11-13 08:42:55 +01:00
Jan Nieuwenhuizen 6449c3424a check-parse: new target. 5 parse failures. 2018-11-12 10:52:39 +01:00
Jan Nieuwenhuizen b68f8c3223 connect backend: WIP 2018-11-12 10:23:01 +01:00
Jan Nieuwenhuizen f6a9bb4109 grammar: strip all keywords. 2018-11-12 10:22:52 +01:00
Jan Nieuwenhuizen 0ee86aa981 grammar: move variable-and, or, regex to variable toplevel. 2018-11-12 10:22:52 +01:00
Jan Nieuwenhuizen b28798b034 grammar: space: allow newline twice. 2018-11-12 10:22:52 +01:00
Jan Nieuwenhuizen b9b6da52b6 grammar: literal: add \<unalias>. mag dat? 2018-11-12 10:22:52 +01:00
Jan Nieuwenhuizen 7483b27f55 Move peg into gash/, compile. 2018-11-12 10:22:40 +01:00
Rutger van Beusekom 2334e6ebde revamp PEG grammar 2018-11-11 20:13:07 +01:00
Jan Nieuwenhuizen 1e81a66926 test: 10-if-redirect. 2018-11-10 12:07:07 +01:00
Jan Nieuwenhuizen 5f2bcb9528 test: add failing 07-variable-or-slash.sh. 2018-11-10 11:55:50 +01:00
Jan Nieuwenhuizen 2ea6d6ce34 WIP: parse mes configure.sh 2018-11-10 11:45:01 +01:00
Jan Nieuwenhuizen 9a96816b5d Support elif. 2018-11-10 11:30:55 +01:00
Jan Nieuwenhuizen 90325b22a2 Support . script, source script. 2018-11-10 11:30:55 +01:00
Jan Nieuwenhuizen 726ca052a9 Support ${ / / }, ${ / }. 2018-11-10 11:30:55 +01:00
Timothy Sample 73414716bb Fix lexing of empty double quotes
* geesh/lexer.scm (get-double-quotation): Handle empty quotation.
* tests/lexer.scm: Add a test for this and for empty single
quotes (which already worked correctly).
2018-11-09 16:22:11 -05:00
Jan Nieuwenhuizen e8f90ba6a8 build: configure. 2018-11-06 17:32:39 +01:00
Jan Nieuwenhuizen 8ca428c7f2 Support ${ # ## % %% }. 2018-11-05 22:47:34 +01:00
Jan Nieuwenhuizen 1e51c5cbd1 basename: New builtin.
* gash/commands/basename.scm: New file.
* build-aux/build-guile.sh: Compile it.
* configure: Create script.
* gash/bournish-commands.scm (basename-command): New variable.
(%bournish-commands): Add it.
2018-11-05 20:46:25 +01:00
Jan Nieuwenhuizen f014281c29 dirname: New builtin.
* gash/commands/dirname.scm: New file.
* build-aux/build-guile.sh: Compile it.
* configure: Create script.
* gash/bournish-commands.scm (dirname-command): New variable.
(%bournish-commands): Add it.
2018-11-05 20:46:25 +01:00
Jan Nieuwenhuizen e8b56af461 pipeline: Fix stray outputs.
* gash/pipe.scm (pipeline+): Do not add extra newlines, flush.
2018-11-05 20:16:39 +01:00
Jan Nieuwenhuizen 8f87f7dffa Support io-here. 2018-11-05 20:16:39 +01:00
Jan Nieuwenhuizen 8d0d50240b Support functions. 2018-11-05 20:16:39 +01:00
Jan Nieuwenhuizen a8a6ea06df compress WIP 2018-11-05 20:16:39 +01:00
Jan Nieuwenhuizen 9cf3ee9e7e WIP > redir 2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen f2fb1bedc9 tar: Cater for Guix bootstrap-guile's UTF-8 default.
* gash/ustar.scm (read-ustar-file): Cater for Guix bootstrap-guile's
UTF-8 default.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 478d75bba7 touch: New builtin.
* gash/commands/touch.scm: New file.
* build-aux/build-guile.sh: Compile it.
* configure: Create script.
* gash/bournish-commands.scm (touch-command): New variable.
(%bournish-commands): Add it.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 78989bfb90 Fix command tracing.
* gash/builtins.scm (term->string): New function.
(trace): Use it to make nicer traces; typo: alway display trace.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 6250b22951 Support && and ||.
* gash/script.scm (and-terms, or-terms): New macros.
* gash/peg.scm (transform): Transform to use them.
(parse-): Parse && and || as binary term operator.
* test/20-and.sh: Test it.
* test/20-or.sh: Test it.
* check.sh (tests): Run it.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 45479fc651 rmdir: New builtin.
* gash/commands/rmdir.scm: New file.
* build-aux/build-guile.sh: Compile it.
* configure: Create script.
* gash/bournish-commands.scm (rmdir-command): New variable.
(%bournish-commands): Add it.
* gash/shell-utils.scm (rmdir-p): New function.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen f62e6e99a7 mkdir: New builtin.
* gash/commands/mkdir.scm: New file.
* build-aux/build-guile.sh: Compile it.
* configure: Create script.
* gash/bournish-commands.scm (mkdir-command): New variable.
(%bournish-commands): Add it.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 678e192b4f chmod: Move permission code to shell-utils.
* gash/shell-utils.scm (<chmodifier>): New record, move from commands/chmod.
(parse-modifier, parse-modifiers, make-numeric-chmodifier,
apply-chmodifiers): New function, move from commands/chmod.
* gash/commands/chmod.scm (chmod): Remove them.
* gash/util.scm (char->string, string->string-list): New function.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 6e396759a3 reboot: Use reboot'.
* gash/commands/reboot.scm (reboot'): Rename from reboot.  Update
users.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 8bcc6d3c82 tar: Extract fix.
* gash/ustar.scm (read-ustar-file): Use binary output port.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 63f2d4b5f8 tar: Support symlinks.
* gash/ustar.scm (read-ustar-file): Support symlinks.
* gash/shell-utils.scm (display-file): Display them.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 005061d712 tar: Support -C.
* gash/commands/tar.scm (tar): Support -C.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen d13de88e43 tar: Support --strip-components.
* gash/commands/tar.scm (tar): Support --strip-components.
* gash/ustar.scm (list-ustar-archive, list-ustar-port,
read-ustar-archive, read-ustar-port, read-ustar-file): Likewise.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 2a4e3ec71b Support escaped newline.
* gash/peg.scm (parse-): Support escaped newline.
* test/01-script-backslash.sh: Test it.
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen bca65e807b Support ${foob-bar} and ${foo+bar}.
* gash/environment.scm (variable): Add default parameter.
(variable-or, variable-and): New function.
* test/07-variable-or.sh: Test it.
* test/07-variable-or-not.sh:
* test/08-variable-and.sh:
* test/08-variable-and-not.sh:
2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen 418652bee1 test: Refactor. 2018-11-05 20:13:26 +01:00
Jan Nieuwenhuizen a0ff0853ff set: Support -u, clumped singles.
* gash/builtins.scm (set-command): Support -u, clumped singles.
* gash/environment.scm (variable): Consider `nounset'.  TODO:
propagate error.
2018-11-05 19:59:53 +01:00
Jan Nieuwenhuizen ac30e252bd Make dependency on geesh optional. 2018-11-05 19:59:53 +01:00
Jan Nieuwenhuizen 992e12444d chmod: New builtin.
* gash/commands/chmod.scm: New file.
* build-aux/build-guile.sh: Compile it.
* .gitignore: Ignore it.
2018-11-05 19:59:53 +01:00
Jan Nieuwenhuizen 6175b07c7e pipe: Connect stderr too.
* gash/pipe.scm (spawn): Connect stderr too.
2018-11-05 19:59:53 +01:00
Jan Nieuwenhuizen aafbc96dbd rm: Resurrect.
* gash/commands/rm.scm: Resurrect.
* gash/bournish-commands.scm: Add it.
* build-aux/build-guile.sh: Compile it.
* .gitignore: Ignore it.
2018-11-05 19:59:53 +01:00