Commit Graph

51 Commits

Author SHA1 Message Date
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 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
Jan Nieuwenhuizen 8ca428c7f2 Support ${ # ## % %% }. 2018-11-05 22:47:34 +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 9cf3ee9e7e WIP > redir 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 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 13cb50af60 gash: resurrect. 2018-10-21 15:24:24 +02:00
Jan Nieuwenhuizen 0f5b538c3a geesh: initial integration.
GUILE_LOAD_PATH=$HOME/src/geesh:$GUILE_LOAD_PATH
    GUILE_LOAD_COMPILED_PATH=$HOME/src/geesh:$GUILE_LOAD_COMPILED_PATH

    bin/gash --parse -c 'echo boo | sed s,o,O, | grep .'
    bin/gash --geesh --parse -c 'echo boo | sed s,o,O, | grep .'
2018-10-21 12:45:51 +02:00
Jan Nieuwenhuizen 292fbc5ecb test/if.sh, test/if2.sh -- weird 2018-07-15 23:27:58 +02:00
Jan Nieuwenhuizen 6468b04791 refactor WORD...bummer: word-for-test-assign-sh word-for-test-if-sh 2018-07-15 23:01:52 +02:00
Jan Nieuwenhuizen 24c35cc5d9 checkpoint 2018-07-15 21:44:15 +02:00
Jan Nieuwenhuizen cbd13fdc88 checkpoint 2018-07-15 20:49:52 +02:00
Jan Nieuwenhuizen e7bfd347fa checkpoint 2018-07-15 20:47:09 +02:00
Jan Nieuwenhuizen 83f20d1ff8 flatten-fu 2018-07-15 20:06:19 +02:00
Jan Nieuwenhuizen e9a57a899c more for-progress 2018-07-15 18:39:17 +02:00
Jan Nieuwenhuizen 8f8ba68c54 resurrect set -x 2018-07-15 18:18:34 +02:00
Jan Nieuwenhuizen e6e03c6da2 parser: handle substitution in for sequence. 2018-07-15 16:08:26 +02:00
Jan Nieuwenhuizen c32034d13d command, builtin, glob, echo cleanup and fixes 2018-07-15 13:43:52 +02:00
Jan Nieuwenhuizen d065723221 parser: refactor, use `pipeline' instead of `expression'. 2018-07-15 12:49:59 +02:00
Jan Nieuwenhuizen 4bb60cc4c3 parse: handle empty script WIP 2018-07-14 23:16:27 +02:00
Jan Nieuwenhuizen 863b3b5908 builtins: test: New command.
* gash/builtins.scm (test-command): New command.
  (%builtin-commands): Add it.
  (builtin, command, doublequotes, expression, for, glob,
  singlequotes, substitution): Move from peg.scm.
* gash/peg.scm: Remove them.
2018-07-14 23:16:13 +02:00
Jan Nieuwenhuizen 48373edb3f WIP: IF hack 2018-07-14 22:48:55 +02:00
Jan Nieuwenhuizen 677deaf9b3 builtins: command: New command.
* gash/builtins.scm   (command-command): New command.
  (%builtin-commands): Add it.
  (builtin): Move from peg.
* gash/peg.scm (builtin): Remove.
2018-07-14 22:48:42 +02:00
Jan Nieuwenhuizen 0408463a13 bah, some uninformed error handling. WIP 2018-07-14 22:48:42 +02:00
Jan Nieuwenhuizen e0169d0acd builtins: Support \non-builtin escape.
* gash/peg.scm (builtin): Add #:prefer-builtin? keyword argument.
  (transform): Support \non-builtin escape.
2018-07-14 15:57:02 +02:00
Jan Nieuwenhuizen e5c6324d82 remove debugging WIP: 2018-07-14 15:56:46 +02:00
Jan Nieuwenhuizen 43d418fab1 some builtin progress WIP 2018-07-14 15:41:03 +02:00
Jan Nieuwenhuizen 56a36baee5 factor-out environment.
* gash/environment.scm: New file.
* build-aux/build-guile.sh (SCM_FILES): Add it.
* gash/peg.scm: Include it.
  (assignment, %global-variables, set-shell-opt!, variable): Remove.
2018-07-14 15:23:52 +02:00
Jan Nieuwenhuizen c896015068 resurrect builtins: WIP 2018-07-14 13:34:10 +02:00
Rutger van Beusekom f5339a09f5 WIP: marginal 2018-07-14 12:34:42 +02:00
Jan Nieuwenhuizen 4d3751f654 resurrect builtins: WIP 2018-07-14 12:24:51 +02:00
Jan Nieuwenhuizen f3c8c2c7f0 exit-stati: WIP 2018-07-14 10:20:05 +02:00
Jan Nieuwenhuizen 42fbcb942a fix exit-status in `command' 2018-07-14 09:46:30 +02:00
Jan Nieuwenhuizen ff985aa083 verder aangehaakt 2018-07-14 09:34:57 +02:00
Rutger van Beusekom 7054858d9a checkpoint 2018-07-13 22:54:22 +02:00
Rutger van Beusekom d5e7cb691d checkpoint 2018-07-13 22:54:22 +02:00
Rutger van Beusekom 745757cfd0 WIP FOO => rewrite me harder 2018-07-13 22:54:22 +02:00
Rutger van Beusekom 01bfb484dc allow reserved words "everywhere" 2018-07-02 08:39:24 +02:00
Jan Nieuwenhuizen a14c7c7360 Use pretty-print to display error tree.
* gash/peg.scm (parse): Use pretty-print to display error tree.
  (parse-): Likewise.
2018-06-30 06:36:54 +02:00
Rutger van Beusekom f171f79ec9 substitution 2017-12-07 23:07:31 +01:00
Rutger van Beusekom 6e556508f5 checkpoint 2017-12-07 23:07:31 +01:00
Rutger van Beusekom 57b93d2902 substitution WIP 2017-12-07 23:07:31 +01:00