Commit Graph

8 Commits

Author SHA1 Message Date
Timothy Sample 87229e4b3a Add arithmetic expansion.
* gash/arithmetic.scm: New file.
* Makefile.am (SOURCES): Add it.
* gash/lexer.scm (get-arithmetic-expansion): New procedure.
(get-expansion): Check for "$((" and use the new procedure to read an
arithmetic expansion.
* gash/eval.scm (word->qword): Handle '<sh-arithmetic>'.
* tests/unit/eval.scm: Add tests.
* tests/spec/Makefile.am (TESTS): Add 'arith'.
* tests/spec/oil.scm: Patch seven of its tests and filter out fifteen
others.
* doc/gash.texi, doc/syntax.txt: Add '<sh-arithmetic>' syntax.
2021-05-26 13:16:50 -04:00
Timothy Sample b2faf08ed4 Mark 'next-char' as inlinable.
* gash/lexer.scm (next-char): Mark as inlinable.
2020-02-04 23:19:22 -05:00
Timothy Sample 9ba534ebff Speed up checking for operators.
* gash/lexer.scm (operator-prefix-char?): Compute the list of prefix
characters ahead of time.
2020-02-04 21:20:49 -05:00
Timothy Sample 7deaa94bd5 Correctly parse double-quoted backquoted commands.
* 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.
2019-12-09 13:04:18 -05:00
Timothy Sample 0c57fc9ef9 Move 'textual-ports' under 'compat'.
* gash/textual-ports.scm: Move this...
* gash/compat/textual-ports.scm: ...here.
* Makefile.am, gash/lexer.scm, gash/parser.scm, gash/shell.scm,
tests/unit/shell.scm: Update references.
2019-05-20 18:07:47 -04:00
Timothy Sample df43ca7215 Add support for Guile 2.0.
* configure.ac (GUILE_PKG): Add 2.0.
* gash/textual-ports.scm: New file.
* Makefile.am: Add it.
* gash/lexer.scm, gash/parser.scm, gash/shell.scm: Use it in place of
'(ice-9 textual-ports)'.
* tests/unit/shell.scm: Use it in place of '(ice-9 textual-ports)';
replace '(ice-9 textual-ports)' with '(rnrs io ports)' in sub-scripts;
and add a shim for 'setvbuf'.
2019-05-20 01:18:54 -04:00
Timothy Sample 50473ac9d4 Add copyright sign to headers.
* gash/built-ins/*, gash/environment.scm, gash/eval.scm,
gash/lexer.scm, gash/parser.scm, gash/repl.scm, gash/word.scm,
tests/unit/*, tools/coverage.in: Add copyright sign to headers.
2019-05-20 01:18:22 -04:00
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