1. 09 Dec, 2019 18 commits
    • Timothy Sample's avatar
      Generate ChangeLog from Git. · f005b1ac
      Timothy Sample authored
      * ChangeLog: Update Git log URL and add a copyright notice.
      * Makefile.am (gen-ChangeLog): Use 'gitlog-to-changelog' to generate
      the ChangeLog.
      f005b1ac
    • janneke's avatar
      gash compat textual-ports: Add put-char. · 6f81266e
      janneke authored and Timothy Sample's avatar Timothy Sample committed
      * gash/compat/textual-ports.scm: Add put-char.
      6f81266e
    • Timothy Sample's avatar
      Initialize the current locale on Guile 2.0. · d905679e
      Timothy Sample authored
      * gash/gash.scm: Initialize the current locale on Guile 2.0.
      d905679e
    • Timothy Sample's avatar
      Allow one-armed 'if-guile-version-below'. · 2d41b4ae
      Timothy Sample authored
      * gash/compat.scm: Allow one-armed 'if-guile-version-below' syntax and
      use it to simplify the conditional definitions throughout.
      2d41b4ae
    • Timothy Sample's avatar
      Use bindings with regular built-ins. · 4f90afcd
      Timothy Sample authored
      * gash/shell.scm (sh:exec-let): Save and set variables according to
      'bindings' before executing a regular built-in.
      4f90afcd
    • Timothy Sample's avatar
      Reap every process in a pipeline. · 8a440f35
      Timothy Sample authored
      * gash/shell.scm (waitpid/any): New procedure.
      (sh:pipeline): Use it to reap every process spawned while executing a
      pipeline.
      8a440f35
    • Timothy Sample's avatar
      Do not leak ports into pipeline processes. · d600f82f
      Timothy Sample authored
      * gash/shell.scm (swap-and-shift-pairs): Remove procedure.
      (make-pipes): Remove procedure.
      (plumb): Accept another port as an argument and close it when setting
      up the child process.
      (sh:pipeline): Do not use 'make-pipes' to create all the pipe ports
      upfront, but rather create them as needed and give them directly to
      'plumb'.
      d600f82f
    • janneke's avatar
      Test executing redirect-created files immediately. · 7eacf528
      janneke authored and Timothy Sample's avatar Timothy Sample committed
      
      
      * tests/redirects.org (Files opened for redirect can be executed
      immediately): New test.
      Co-authored-by: Timothy Sample's avatarTimothy Sample <samplet@ngyro.com>
      7eacf528
    • Timothy Sample's avatar
      Close ports opened for redirects. · 121d9cb4
      Timothy Sample authored
      * gash/shell.scm (redir->parameter+port): Rename this...
      (process-redirect): ...to this, and make it return a list with the
      third element being a boolean indicating if the port was opened by us.
      (sh:with-redirects): Close ports when the new boolean is set.
      121d9cb4
    • Timothy Sample's avatar
      Enable 'glob' specification test · 22205a00
      Timothy Sample authored
      * tests/spec/Makefile.am (TESTS): Add 'glob'.
      * tests/spec/oil.scm: Patch one of its tests and filter out eleven
      others.
      22205a00
    • Timothy Sample's avatar
      Respect the 'noglob' option. · 168f4229
      Timothy Sample authored
      * gash/word.scm (expand-pathnames): Do not expand pathnames if the
      'noglob' option is set.
      168f4229
    • Timothy Sample's avatar
      Fix pathname expansion. · 3d3375e0
      Timothy Sample authored
      The old implementation had several bugs, prompting this complete
      rewrite.
      
      * gash/compat/srfi-43.scm (vector-empty?): New procedure.
      * gash/pattern.scm (pattern-null?): New procedure.
      * gash/word.scm (qword->pattern-string): New procedure.
      (qword->pattern): Rewrite using 'qword->pattern-string'.
      (find-files): New procedure.
      (expand-pathnames): Rewrite using 'find-files' and add a docstring.
      * tests/unit/word.scm: Add tests.
      (mock): New syntax.
      (make-pure-scandir): New procedure.
      (with-mocked-files): New syntax.
      3d3375e0
    • Timothy Sample's avatar
      Simplify the 'pattern' data structure. · 76875521
      Timothy Sample authored
      * gash/pattern.scm (<pattern>): Remove the 'start-anchored?' and
      'end-anchored?' fields.
      (parse-pattern): Replace the fields with empty parts at the start or
      end of the parts list.
      (pattern-plain?): Instead of checking the fields, just check the
      number of parts.
      (pattern-match?, pattern-drop, pattern-drop-right): Do not worry about
      the fields, because the empty parts ensure the right thing happens.
      76875521
    • Timothy Sample's avatar
      Swap semantics of ':+' and '+'. · cf6a886f
      Timothy Sample authored
      These were mixed up, with ':+' behaving like '+' and vice versa.
      
      * gash/word.scm (word->qword): Swap implementations of '<sh-ref-and>'
      and '<sh-ref-and*>'.
      * tests/unit/word.scm: Swap tests.
      cf6a886f
    • Timothy Sample's avatar
      Enable 'command-sub' specification test · 4acbd303
      Timothy Sample authored
      * tests/spec/Makefile.am (TESTS): Add 'command-sub'.
      * tests/spec/oil.scm: Patch four of its tests and filter out another.
      4acbd303
    • Timothy Sample's avatar
      Fix case statements in '$(...)' substitutions. · 49ac5e74
      Timothy Sample authored
      * gash/parser.scm (make-parser): Fix the 'pattern!' rule so that it
      gets reduced before reading an 'RPAREN' token.
      49ac5e74
    • Timothy Sample's avatar
      Add test for backquoted commands in heredocs. · 66685b62
      Timothy Sample authored
      * tests/unit/parser.scm: Add test.
      66685b62
    • Timothy Sample's avatar
      Correctly parse double-quoted backquoted commands. · 7deaa94b
      Timothy Sample authored
      * gash/lexer.scm (read-backquoted-command): Make the default procedure
      accept a 'quoted?' keyword.
      (get-backquoted-command): Accept a 'quoted?' keyword and pass it on to
      'read-backquoted-command'.
      (get-expansion): Accept a 'quoted?' keyword and pass it on to
      'get-backquoted-command'.
      (get-double-quotation): Set the 'quoted?' keyword when calling
      'get-expansion'.
      * tests/unit/lexer.scm: Add tests.
      * gash/parser.scm (call-with-backquoted-input-port): Accept a
      'quoted?' keyword which, if set, adds the double quote character to
      the set of escapable characters.
      (read-sh/backquoted): Accept a 'quoted?' keyword and pass it on to
      'call-with-backquoted-input-port'.
      * tests/unit/parser.scm: Add tests.
      7deaa94b
  2. 08 Dec, 2019 8 commits
    • Timothy Sample's avatar
      Implement asserting references. · 8135e199
      Timothy Sample authored
      * gash/word.scm (word->qword): Add an implementation for the
      '<sh-ref-assert>' and '<sh-ref-assert*>' cases.
      * tests/variable-operators.org: New file.
      * Makefile.am (FULL_TESTS): Add it.
      8135e199
    • Timothy Sample's avatar
      Reset exit status on assignment. · 7fee72f5
      Timothy Sample authored
      * gash/eval.scm (eval-word): Add 'on-command-substitution' keyword.
      (eval-sh): On '<sh-set!>' reset the exit status unless a command
      substitution has occurred.
      * tests/assignments.org: Add tests.
      7fee72f5
    • Timothy Sample's avatar
      Initialize the 'IFS' variable. · 9d984058
      Timothy Sample authored
      * gash/environment.scm (initial-variables): Initialize 'IFS'.
      9d984058
    • Timothy Sample's avatar
      Only throw for specific special built-in errors. · d6a582f1
      Timothy Sample authored
      * gash/shell.scm (sh:exec-let): Do not throw on special built-in
      errors.
      * gash/built-ins/break.scm (main),
      gash/built-ins/continue.scm (main),
      gash/built-ins/return.scm (main),
      gash/built-ins/shift.scm (main): Throw on error.
      d6a582f1
    • Timothy Sample's avatar
      Make 'trap' handle a numerical action. · 6990d656
      Timothy Sample authored
      * gash/built-ins/utils.scm (string->nonnegative-integer): New procedure.
      * gash/built-ins/trap.scm (main): If the first argument is a number,
      treat it as if the action were '-'.
      6990d656
    • Timothy Sample's avatar
      Fix 'string->positive-integer' docstring typo. · 38001cb7
      Timothy Sample authored
      * gash/built-ins/utils.scm (string->positive-integer): Fix a typo in
      the docstring.
      38001cb7
    • Timothy Sample's avatar
      Make 'read' handle logical lines. · 804b6cbe
      Timothy Sample authored
      * gash/built-ins/read.scm (read-logical-line): New procedure.
      (main): Use it unless given the '-r' option.
      * tests/read.org: Add tests.
      804b6cbe
    • Timothy Sample's avatar
      Make 'read' handle input field splitting. · 5fed1b0d
      Timothy Sample authored
      * gash/built-ins/read.scm (split-fields): New procedure.
      (main): Use it to split the input into fields and assign each field to
      its corresponding variable.
      * tests/read.org: New file.
      * Makefile.am (FULL_TESTS): Add it.
      5fed1b0d
  3. 24 Nov, 2019 13 commits
  4. 20 Aug, 2019 1 commit