Commit Graph

7 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 3a4433371f Fill out the manual.
* doc/gash.texi: Add an introduction, add a discussion of included and
missing features, document the parser interface, and remove the
indexes.
* doc/syntax.txt: Update to match the manual.
2019-06-01 11:09:07 -04:00
Timothy Sample 597a6bcfb1 Touch up metadata and copyright notices.
* build-aux/gitlab-ci.yml,
build-aux/pre-inst-env.in,
configure.ac,
test.sh,
tests/spec/Makefile.am,
tests/spec/check-spec: Add copyright notices and GPLv3+ license notice.
* guix.scm: Add a "special exception" permissive license notice.
* doc/syntax.txt: Add title, introduction, copyright notice, and a
simple all-permissive license.
* COPYING.CC0: New file.
* NEWS: Reformat and add CC0 license notice.
* README: Add CC0 license notice.
* Makefile.am: Add copyright notices and GPLv3+ license notice.
(EXTRA_DIST): Add COPYING.CC0.
2019-05-22 00:44:39 -04:00
Timothy Sample c79cea756d Rename '<sh-pipe>' to '<sh-pipeline>'
* doc/syntax.txt: Rename '<sh-pipe>' to '<sh-pipeline>'.
* geesh/parser.scm (make-parser): Ditto.
* tests/parser.scm: Fix test accordingly.
2018-07-19 01:19:00 -04:00
Timothy Sample f149d42b82 Add '<sh-not>' to syntax document
* doc/syntax.txt: Add '<sh-not>'.
2018-07-19 01:04:28 -04:00
Timothy Sample 2aa8615f9e Update AST for command substitutions
The AST generated by the parser did not match the syntax document.
However, neither were right.  This commit updates the syntax document
to describe a more consistent form, and fixes the code to follow it.

* doc/syntax.txt (word): Make the children of '<sh-cmd-sub>' a
possibly empty list of 'list's.
* geesh/lexer.scm (get-bracketed-command): Splice in children for
'<sh-cmd-sub>'.
(get-backquoted-command): Ditto.
* geesh/parser.scm (read-sh/bracketed): Make sure that result is
always a list.
(read-sh/backquoted): Ditto.
* tests/lexer.scm: Update tests accordingly.
* tests/parser.scm: Ditto.
2018-07-18 14:27:11 -04:00
Timothy Sample 48ee11a6fb Add syntax specification document
* doc/syntax.txt: New file.
2018-07-16 13:59:40 -04:00