2020-07-12  Timothy Sample  <samplet@ngyro.com>

	Setup ChangeLog generation.

	* ChangeLog: Use the usual ChangeLog template.
	* build-aux/gitlog-to-changelog: New file.
	* build-aux/gitlog-to-changelog-repro.patch: New file.
	* Makefile.am (EXTRA_DIST): Add them.
	(build-aux/gitlog-to-changelog-repro): New target.
	(gen-ChangeLog): New target.
	(dist-hook): Add 'gen-ChangeLog' as a dependency.

2020-07-05  Timothy Sample  <samplet@ngyro.com>

	Make Git ignore all '*.trs' files.

2020-07-04  Timothy Sample  <samplet@ngyro.com>

	file-formats: Add the 'c' conversion specifier.

	* gash-utils/file-formats.scm (<conversion-adapter>): Add
	'to-character' field.
	(fold-file-format): Deconstruct the new field and use it to handle
	conversions with 'character' type.
	(parse-conversion): Add 'c'.
	* gash/commands/awk.scm (eval-awke/character): New procedure.
	(awk-conversion-adapter): Use it as the 'to-character' adapter.
	* gash/commands/printf.scm (printf-conversion-adapter): Add a
	'to-character' adapter.
	* tests/awk.org: Add tests.
	* tests/printf.org: Likewise.

2020-07-04  Timothy Sample  <samplet@ngyro.com>

	file-formats: Add the 'u' conversion specifier.

	* gash-utils/file-formats.scm (parse-conversion): Add 'u'.

2020-07-04  Timothy Sample  <samplet@ngyro.com>

	awk: Rewrite the backend.

	This change represents a rewrite of the Awk backend.  Many functions
	and code snippets have been carried over, but many more have been
	added, fixed, or rewritten.  There are a few differences worth
	highlighting:

	  - Awk variables are no longer built on immutable data structures.
	    This makes it much easier to pass arrays by reference into
	    user-defined functions.
	  - This also makes it easier to properly handle type constraints,
	    which is now done quite accurately (with respect to Gawk).
	  - We support numeric strings (as specified by POSIX).
	  - Rather than using '(ice-9 receive)' to handle multiple values,
	    we use extended 'let' syntax in the style of SRFI 71.
	  - There is no longer a distinction between commands and
	    expressions.
	  - Most built-in functions are implemented, and most special
	    variables work as intended.

	* gash/commands/awk.scm: Rewrite file.
	* tests/awk.org: Fix two tests, add several others.

2020-07-03  Timothy Sample  <samplet@ngyro.com>

	awk: lexer: Support octal character escapes.

	* gash/commands/awk/lexer.scm (octal-char?): New procedure.
	(octal-chars->char): New procedure.
	(get-escape): Process octal escapes.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: Simplify 'awk-expression->boolean'.

	* gash/commands/awk.scm (awk-expression): In the 'string-match'
	case, return '#t' instead of the regex match object on success.
	(awk-expression->boolean): Do not handle regex match objects.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: Make 'awk-expression->string' multi-valued.

	* gash/commands/awk.scm (awk-expression->string): Return an updated
	environment as well as the result; fall back on 'awk-expression' for
	unknown forms.
	(awk-length, awk-index, awk-expression, awk-conversion-adapter,
	awk-printf, run-commands): Update accordingly.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: Support user-defined functions.

	* gash/commands/awk.scm (<awk-undefined>): New record type.
	(*awk-undefined*): Use the new record type.
	(<awk-array>): Add 'location' field.
	(awk-array-null): Remove variable.
	(make-awk-array): New procedure.
	(<env>): Add 'depth' and 'frame' fields.
	(make-default-env): Initialize the new fields.
	(push-env-frame): New procedure.
	(pop-env-frame): New procedure.
	(%env-ref): New procedure.
	(%env-set): New procedure.
	(env-ref, env-set, env-ref/array): Rewrite to support frames and
	references.
	(env-set*): Rename this...
	(env-set-globals): ...to this.
	(load-file, read-record): Update references.
	(env-set-array): Remove procedure.
	(awk-split, awk-set): Do not use 'env-set-array'.
	(awk-expression): Remove special case for applying a function with a
	single argument; make the general case work with zero arguments.
	(run-commands): Handle 'return' forms.
	(*return-prompt*): New variable.
	(make-function): New procedure.
	(eval-function-definition): New procedure.
	(%eval-awk): Use it to evaluate function definitions.
	* tests/awk.org: Add tests.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: Preserve array type information.

	* gash/commands/awk.scm (ensure-array): Remove procedure.
	(env-ref/array): New procedure.
	(env-set-array, awk-expression, run-commands): Use it.
	* tests/awk.org: Add tests.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: Refactor variable procedures.

	* gash/commands/awk.scm (delete-var): Remove procedure.
	(get-var): Rename this...
	(env-ref): ...to this.
	(assign): Rename this...
	(env-set): ...to this, adjusting for the removed 'delete-var'.
	(assign*): Rename this...
	(env-set*): ...to this.
	(assign-array): Rename this...
	(env-set-array): ...to this.
	(awk-split, awk-set, awk-expression, run-commands, load-file,
	read-record): Update references.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: Do not save key variable in for-each loops.

	* gash/commands/awk.scm (run-commands): Do not save key variable in
	for-each loops.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: Use a distinct type for arrays.

	* gash/commands/awk.scm (<awk-array>): New record type.
	(awk-array-null): New variable.
	(awk-array-ref): New procedure.
	(awk-array-member?): New procedure.
	(awk-array-set): New procedure.
	(awk-array-delete): New procedure.
	(awk-array-keys): New procedure.
	(ensure-array): New procedure.
	(awk-expression->string, awk-expression->boolean,
	awk-expression->number): Raise an error if passed an array.
	(assign-array, awk-expression, run-commands): Use the new type.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: Use an explicit and distinct undefined value.

	* gash/commands/awk.scm (*awk-undefined*): New variable.
	(awk-undefined?): New procedure.
	(awk-not): Remove procedure.
	(get-var): Allow specifying a default value (which is
	'*awk-undefined*' by default); allow returning a boolean '#f'.
	(awk-expression->string, awk-expression->boolean,
	awk-expression->number): Handle the new undefined value.
	(awk-expression): Update array cases for the new undefined value; use
	'awk-expression->boolean' in place of 'awk-not'.
	(run-commands): Use 'awk-expression->string' when printing.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Parse function application.

	* gash/commands/awk/lexer.scm (get-word): Before returning a 'NAME'
	token, check if the next character is an open parenthesis and if so,
	return a 'NAME+LPAREN' token.
	* gash/commands/awk/parser.scm (make-parser): Use the new token to
	parse function application.
	* tests/unit/awk-parser.scm: Add tests for this and for built-in
	functions.

2020-07-02  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Parse 'getline'.

	* gash/commands/awk/parser.scm (make-parser): Mark the 'PIPE' and
	'<' non-terminals as right-associative; add the 'input-expr'
	non-terminal and use it in 'comp-expr'; add the 'simple-get'
	non-terminal and use it in 'base-expr'.
	* tests/unit/awk-parser.scm: Add tests.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Redesign the AST.

	This is a rather large change.  It replaces the old, implicit AST with
	one that is explicitly specified in a new file.  To build confidence
	that the parser generates an AST that adheres to the specification,
	many tests are added.  As a result of adding the tests, a handful of
	parser bugs or missing features were exposed, all of which are
	addressed by this change.

	* doc/awk-syntax.txt: New file.
	* Makefile.am (EXTRA_DIST): Add it.
	* gash/commands/awk/lexer.scm (*operators*): Add '%='.
	* gash/commands/awk/parser.scm (strip-progn): New procedure.
	(unwrap-singleton): New procedure.
	(make-parser): Generate an AST according to the new specification;
	generate usable function declaration nodes; fix pattern ranges;
	handle multi-dimensional array keys everywhere.
	* tests/unit/awk-parser.scm: Add tests.
	* gash/commands/awk.scm (awk-name): Delete procedure.
	(awk-set, awk-expression, eval-special-items, %eval-awk): Consume
	the new AST.
	(run-commands): Do not handle item-level nodes; consume the new AST;
	do not skip unknown commands.
	(load-file, read-record, make-default-env): Use symbols for variable
	names.
	(eval-item): New procedure.
	(run-awk-file): Use it instead of 'run-commands'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Put in and out ports into the environment.

	* gash/commands/awk.scm (<env>): Add 'in' and 'out' fields.
	(run-commands): Remove 'inport' and 'outport' arguments; update
	recursive calls.
	(load-file): New procedure.
	(read-record): Remove 'inport' argument.
	(run-awk-file): Use 'load-file' to open the file; update calls to
	'read-record' and 'run-commands'.
	(eval-special-items): Remove 'out' argument; update recursive calls
	and a call to 'run-commands'.
	(make-default-env): Add an 'out' argument; initialize the new
	fields.
	(%eval-awk): Update calls to 'eval-special-items', 'run-awk-file',
	and 'make-default-env'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Put record and fields into the environment.

	* gash/commands/awk.scm (<env>): Add 'record' and 'fields' fields.
	(awk-expression): Use them instead of the '*line*' and '*fields*'
	variables.
	(run-commands): Do not accept a 'fields' arguments but use 'fields'
	from the environment instead; update recursive calls.
	(eval-special-items): Do not pass 'fields' to 'run-commands'.
	(read-record): New procedure.
	(run-awk-file): Use it to simplify the record processing loop; do
	not pass 'fields' to 'run-commands'.
	(make-default-env): Initialize the new fields.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Wrap the variables alist in a record.

	This is a weird change, but it clears the way for several
	forthcoming cleanups.

	* gash/commands/awk.scm (<env>): New record.
	(delete-var, assign, assign*, assign-array, get-var): Unwrap and
	re-wrap the variables alist.
	(awk-split, awk-length, awk-substr, awk-index, awk-not,
	awk-expression->boolean, awk-expression->number, awk-set,
	awk-expression, next-record, break-loop, awk-conversion-adapter,
	awk-printf, run-commands, run-awk-file): Rename 'variables' to
	'env'.
	(make-default-env): New procedure.
	(%eval-awk): Rename 'variables' to 'env' and initialize 'env' using
	'make-default-env'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Only access variables through procedures.

	* gash/commands/awk.scm (assign*): New procedure.
	(awk-expression): Do not use 'get-var' for array access.
	(run-commands): When handling '<awk-for-in>', use 'get-var' and
	'assign' instead of their alist equivalents.
	(run-awk-file): Use 'assign*' for setting variables.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Allow breaking out of 'for' loops.

	* gash/commands/awk.scm (*break-loop-prompt*): New variable.
	(break-loop): New procedure.
	(run-commands): In the '<awk-for>' case, set up a prompt; add the
	'<awk-break>' case, which escapes to said prompt.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Fix off-by-one error in field references.

	* gash/commands/awk.scm (awk-expression): Use strict inequality when
	checking if a field reference is to big.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: lexer: Handle more escape sequences.

	* gash/commands/awk/lexer.scm (*escape-map*): Add '/', 'a', 'b', 'f',
	'n', 'r', and 'v'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: lexer: Break words on quotes.

	* gash/commands/awk/lexer.scm (get-word): Do not continue reading
	through a double quote character.
	* tests/unit/awk-parser.scm: Add test.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Parse the 'getline' keyword.

	* gash/commands/awk/lexer.scm (*reserved-words*): Add 'getline'.
	* gash/commands/awk/parser.scm (make-parser): Add the 'Getline'
	terminal.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Treat non-number strings as 0.

	* gash/commands/awk.scm (awk-expression->number): If a string cannot
	be parsed as a number, return 0.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Support 'while' and 'do' loops.

	* gash/commands/awk/parser.scm (make-parser): Fix off-by-one errors
	when parsing 'while' and 'do' loops.
	* gash/commands/awk.scm (run-commands): Handle the '<awk-while>' and
	'<awk-do>' cases.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Handle the 'D' function.

	* gash/commands/sed.scm (<env>): Add 'read?' field.
	(execute-function): Handle the 'D' function.
	(edit-stream): Only read the next line when 'read?' is set; reset
	the 'read?' flag before looping.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Move 'cycle?' flag into the environment.

	* gash/commands/sed.scm (<env>): Add 'cycle?' field.
	(execute-function): When aborting to the 'end-of-script-tag', only
	pass the updated environment and update the 'cycle?' field if
	necessary.
	(execute-commands): When aborting to the 'end-of-script-tag', only
	pass the updated environment.
	(edit-stream): Initialize the 'cycle?' field; only accept the
	environment in the prompt handler; only loop when the 'cycle?' field
	is set.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Handle the 'P' function.

	* gash/commands/sed.scm (execute-function): Handle the 'P' function.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Ignore comments.

	* gash/commands/sed.scm (execute-function): Ignore the 'comment'
	function.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Tell Emacs how to indent 'set-fields'.

	* gash/commands/sed.scm: Add local variables for Emacs.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	options: Work around old SRFI 37 bug.

	* gash-utils/options.scm (make-sentinel): New procedure.
	(fix-grammar-for-null-args): New procedure.
	(parse-options): Rename this...
	(%parse-options): ...to this.
	(parse-options): New procedure.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: reader: Fix handling of bracket expressions.

	* gash/commands/sed/reader.scm (read-bracket-expression): Fix
	reading collating symbols, equivalence classes, and character
	classes.
	* tests/unit/sed-reader.scm: New file.
	* Makefile.am (UNIT_TESTS): Add it.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	ls: Fix dotfile predicate.

	* gash/commands/ls.scm (ls): Do not treat paths starting with '../'
	as dotfiles.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	rmdir: Do not echo arguments.

	* gash/commands/rmdir.scm (rmdir): Do not echo arguments.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	Add 'env' utility.

	* gash/commands/env.scm: New file.
	* Makefile.am (SOURCES): Add it.
	(WRAPPERS): Add 'scripts/env'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	mv: Do not allow an empty source list.

	* gash/commands/mv.scm (mv): Do not allow an empty source list when
	moving multiple files into a directory (i.e., change the pattern from
	'...' to '..1').

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	mv: Use 'parse-options'.

	* gash/commands/mv.scm (*help-message*): New variable.
	(*version-message*): New variable.
	(*options-grammar*): New variable.
	(mv): Use 'parse-options'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	options: Preserve the order of operands.

	* gash-utils/options.scm (make-options-grammar): By default, append
	operands to the end of the operand list.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: reader: Fix a docstring typo.

	* gash/commands/sed/reader.scm (read-re-until): Replace "It order"
	with "In order".

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Handle 'printf' statements.

	* gash/commands/awk/lexer.scm (*reserved-words*): Add 'printf'.
	* gash/commands/awk/parser.scm (make-parser): Add the 'Printf'
	terminal; add 'printf' cases to 'simple-print-statement'.
	* gash/commands/awk.scm (awk-conversion-adapter): New variable.
	(awk-printf): New procedure.
	(run-commands): Use it to handle the 'printf' case.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	file-formats: Allow disabling escape handling.

	* gash-utils/file-formats.scm (parse-file-format): Add an 'escaped?'
	keyword to indicate whether the input string is escaped.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	file-formats: Add commentary.

	* gash-utils/file-formats.scm: Add commentary.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	printf: Handle numeric conversion specifiers.

	* gash-utils/file-formats.scm (<conversion>): New record type.
	(make-conversion): New procedure.
	(<conversion-adapter>): New record type.
	(parse-conversion): Return '<conversion>' records instead of
	procedures; handle the 'd' specifier.
	(eval-file-format): Rename this...
	(fold-file-format): ...to this; use a '<conversion-adapter>' to
	adapt arguments to specifier types.
	* gash/commands/printf.scm (printf-conversion-adapter): New
	variable.
	(printf): Use it to call 'fold-file-format'.
	(main): Exit with the result of 'printf'; use 'exit' instead of
	'primitive-exit', handling the 'quit' key in the throw handler.
	* tests/printf.org: Add tests.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	file-formats: Adjust implementation.

	* gash-utils/file-formats.scm (parse-escape): New procedure.
	(parse-escaped-string): Delete procedure.
	(parse-conversion-specifier): Rename this...
	(parse-conversion): ...to this.
	(parse-file-format): Reimplement using 'string-index' and
	'parse-escape'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	Add '(gash-utils file-formats)'.

	* gash/commands/printf.scm (parse-escaped-string,
	parse-conversion-specifier, parse-file-format,
	eval-file-format): Move these...
	* gash-utils/file-formats.scm: To this new file.
	* Makefile.am (SOURCES): Add it.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	printf: Rename format procedures.

	* gash/commands/printf.scm (parse-format-string): Rename this...
	(parse-file-format): ...to this.
	(eval-format-string): Rename this...
	(eval-file-format): ...to this.
	(printf): Update references.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Allow repeating range addresses.

	* gash/commands/sed.scm (address->pred): Replace the specialized
	range cases with one general rule that allows ranges to match more
	than once.
	* tests/sed.org: Add a test.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Handle the 'c' function.

	* gash/commands/sed.scm (fast-forward): New procedure.
	(execute-commands): Handle the 'c' function.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Support a particular Automake redirect.

	* gash/commands/awk.scm (run-commands): Support '<awk-print-to>' when
	the redirect is a pipe to 'cat >&2'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Parse output redirects.

	* gash/commands/awk/lexer.scm (*operators*): Add '>>' and '|'.
	* gash/commands/awk/parser.scm (make-parser): Add '>>' and 'PIPE' as
	terminals; add 'output-redirection' as a nonterminal and adjust
	'print-statement' to use it; add 'print-expr-list-opt',
	'print-expr-list', 'print-expr', 'print-assign-expr',
	'print-cond-expr', 'print-or-expr', 'print-and-expr',
	'print-member-expr', and 'print-re-expr' as nonterminals and adjust
	'simple-print-statement' to use 'print-expr-list-opt'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Return '#t' even after quitting.

	* gash/commands/sed.scm (edit-stream): Use '(const #t)' instead of
	'noop' as the way of escaping the main loop.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	sed: Make the main loop tail-recursive.

	On (bootstrap) Guile 2.0, looping from either 'unless' or
	'call-with-prompt' causes Sed to crash on large inputs.

	* gash/commands/sed.scm (edit-stream): Use 'if' instead of 'unless';
	do not loop from inside of 'call-with-prompt'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Unify lvalue handling.

	As a by-product, 'awk-array-ref' lvalues are now supported everywhere.

	* gash/commands/awk.scm (awk-set): New procedure.
	(awk-expression): Use it in all assignment cases (currently '++',
	'--', '=', and '+=').

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Add support for custom record separators.

	* gash/commands/awk.scm (run-awk-file): Use 'read-delimited' with the
	'RS' variable instead of 'read-line'.
	(%eval-awk): Initialize the 'RS' variable.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Handle bare patterns.

	* gash/commands/awk.scm (run-commands): Handle the bare pattern case
	by wrapping it in an item with the 'awk-print' action.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Let an item follow a terminated item.

	This change broke the trick used to disambiguate postfix operators.
	That is why it is now resolved with precedence rules.

	* gash/commands/awk/parser.scm (make-parser): Add 'terminator-opt';
	use it after 'terminated-item' in 'item-list'; give '++' and '--'
	right associativity; remove 'prepostfix-expr*'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Let scripts end without a terminal.

	* gash/commands/awk/parser.scm (make-parser): Allow programs that end
	without a final terminal.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Rename item nonterminals.

	* gash/commands/awk/parser.scm (make-parser): Rename 'item' to
	'terminated-item' and 'actionless-item' to 'unterminated-item'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Simplify by only using one item list.

	* gash/commands/awk/parser.scm (make-parser): Add 'actionless-item',
	handle it in 'item-list', and remove 'actionless-item-list'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Move 'action' into 'item'.

	* gash/commands/awk/parser.scm (make-parser): Handle bare actions in
	'item' rather than 'item-list'.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Disallow bare special patterns.

	* gash/commands/awk/parser.scm (make-parser): Split patterns into
	normal patterns and special patterns; only allow normal patterns as
	items.

2020-07-01  Timothy Sample  <samplet@ngyro.com>

	awk: Handle regular expression field splitting.

	* gash/commands/awk.scm (string-split/regex): New procedure.
	(string-split/awk): Use it to handle regex field splitting.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	tar: Unpack non-ASCII files properly.

	* gash/ustar.scm (read-ustar-file): Use 'put-bytevector' to write a
	block instead of treating it as an ASCII string.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	rm: Exit gracefully when no files are specified.

	* gash/commands/rm.scm (rm): When no files are specified and the force
	flag is not in effect, print a warning and exit.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	mkdir: Use 'parse-options'.

	(*help-message*): New variable.
	(*version-message*): New variable.
	(*options-grammar*): New variable.
	(mkdir'): Use 'parse-options' instead of 'getopt-long'; remove help
	and version message handling.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	mkdir: Fix handling of 'mode' option.

	* gash/commands/mkdir.scm (call-with-umask): New procedure.
	(mkdir'): Invert 'mode' before using it as a umask; use
	'call-with-umask' to temporarily change the umask.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	rm: Add a stub for interactive mode.

	* gash/commands/rm.scm (*help-message*): Add 'interactive' option.
	(*options-grammar*): Remove 'force' flag and replace it with
	'communication', which handles both 'force' and 'interactive'.
	(rm): Replace 'force' with 'communication'; error out if communication
	is set to 'ask' (interactive mode).

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	rm: Add 'help' and 'version' options.

	* gash/commands/rm.scm (*help-message*): New variable.
	(*version-message*): New variable.
	(*options-grammar*): Add 'help' and 'version' options.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	Add '%package-name' configuration variable.

	* gash/commands/config.scm.in (%package-name): New variable.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	rm: Use 'parse-options'.

	* gash/commands/rm.scm (*options-grammar*): New variable.
	(rm): Parse options using 'parse-options'.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	Add '(gash-utils options)'.

	* gash-utils/options.scm: New file.
	* Makefile.am (SOURCES): Add it.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	rm: Process all arguments.

	* gash/commands/rm.scm (rm): Move the 'catch' form inside of the
	argument processing loop; use fold to keep track of the return
	status.
	(main): Exit with the result of calling 'rm'.
	* tests/core-utils.org: Add a test.

2020-06-29  Timothy Sample  <samplet@ngyro.com>

	sed: Handle EOF in the 'n' function.

	* gash/commands/sed.scm (execute-function): Handle EOF when reading
	the next line for the 'n' function.
	* tests/sed.org: Add test.

2020-06-28  Timothy Sample  <samplet@ngyro.com>

	sed: In the 'n' function, respect the '-n' option.

	* gash/commands/sed.scm (<env>): Add 'quiet?' field.
	(edit-stream): Initialize it.
	(execute-function): Suppress output in the 'n' function when 'quiet?'
	is set.
	* tests/sed.org: Add test.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	awk: Handle field splitting special case.

	* gash/commands/awk.scm (char-set:awk-non-space): New variable.
	(string-split/awk): New procedure.
	(awk-split): Use it instead of 'string-split'.
	(run-awk-file): Likewise.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	printf: Processes specifiers and escapes.

	* gash/commands/printf.scm (parse-escaped-string): New procedure.
	(parse-conversion-specifier): New procedure.
	(parse-format-string): New procedure.
	(eval-format-string): New procedure.
	(printf): Use the new procedures.
	(main): Ensure that 'args' is not empty.
	* tests/printf.org: New file.
	* Makefile.am (FULL_TESTS): Add it.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	printf: Fix typo (change 'ags' to 'args').

	* gash/commands/printf.scm (main): Rename 'ags' to 'args'; pass
	'args' to 'printf' instead of '(cdr args)'.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	awk: Add an if-statement test.

	* tests/unit/awk-parser.scm: Add a dangling else test.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Fix print statement ambiguity.

	* gash/commands/awk/parser.scm (make-parser): Remove associativity
	mark from 'RPAREN'; replace 'expr-list' with 'multiple-expr-list' in
	'simple-print-statement'.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	awk: parser: Handle precedence implicitly.

	* gash/commands/awk/parser.scm (make-parser): Remove associativity and
	precedence annotations from most operators; rewrite how expressions
	are parsed.
	* tests/unit/awk-parser.scm: New file.
	* Makefile.am (UNIT_TESTS): Add it.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	awk: lexer: Allow escaped tabs ('\t').

	* gash/commands/awk/lexer.scm (*escape-map*): New variable.
	(standard-escape-map): New procedure.
	(get-escape): Rename 'pred' to 'escape-map' and use
	'standard-escape-map' as the default; translate escaped characters
	using 'escape-map'.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	awk: Add the 'index' built-in.

	* gash/commands/awk.scm (awk-index): New procedure.
	(%eval-awk): Initialize the 'index' variable.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	awk: lexer: Add missing built-ins.

	* gash/commands/awk/lexer.scm (*builtins*): Add atan2, index, match,
	and sprintf.

2020-04-11  Timothy Sample  <samplet@ngyro.com>

	awk: Support the 'next' statement.

	* gash/commands/awk.scm (*next-record-prompt*): New variable.
	(next-record): New procedure.
	(run-commands): Use it to handle the '<awk-next>' case.
	(run-awk-file, eval-special-items): Call 'run-commands' with the
	next-record prompt.

2020-03-19  Timothy Sample  <samplet@ngyro.com>

	awk: Support printing multiple expressions.

	* gash/commands/awk.scm (run-commands): In the '<awk-print>' case
	with multiple expressions, evaluate and print each of them.

2020-03-18  Timothy Sample  <samplet@ngyro.com>

	awk: Thread environment through array references.

	* gash/commands/awk.scm (awk-expression): Do not ignore the resulting
	environment (variables) when evaluating array indexes.

2020-03-18  Timothy Sample  <samplet@ngyro.com>

	awk: Thread environment through function calls.

	* gash/commands/awk.scm (awk-expression): Do not ignore the resulting
	environment (variables) when evaluating function arguments.

2020-03-16  Timothy Sample  <samplet@ngyro.com>

	awk: Fix assignment operator precedence.

	* gash/commands/awk/parser.scm (make-parser): Give assignment
	operators the lowest precedence.
	* tests/awk.org: Add test.

2020-03-16  Timothy Sample  <samplet@ngyro.com>

	awk: Add support for addition assignment.

	* gash/commands/awk.scm (awk-expression): Handle '+='.
	* tests/awk.org: Add test.

2020-03-16  Timothy Sample  <samplet@ngyro.com>

	awk: Allow expressions everywhere.

	* gash/commands/awk.scm (run-commands): Process expressions, too.

2020-03-16  Timothy Sample  <samplet@ngyro.com>

	awk: Fix prefix increment and decrement.

	* gash/commands/awk/parser.scm (make-parser): When reducing prefix
	increment and decrement operators, capture the variable name instead
	of the operator.
	* gash/commands/awk.scm (awk-expression): Bind the values from
	'awk-expression->number' before incrementing or decrementing them.
	* tests/awk.org: Add tests.

2020-03-16  Timothy Sample  <samplet@ngyro.com>

	awk: Update environment when printing expressions.

	* gash/commands/awk.scm (run-commands): Return the resulting
	environment from 'awk-expression' when printing an expression.

2020-03-16  Timothy Sample  <samplet@ngyro.com>

	awk: Simplify evaluating BEGIN and END items.

	* gash/commands/awk.scm (run-commands): Ignore BEGIN and END items.
	(begin-block, end-block): Remove procedures.
	(eval-special-items): New procedure.
	(%eval-awk): Do not split out BEGIN and END items before evaluating.

2020-03-16  Timothy Sample  <samplet@ngyro.com>

	awk: Move logic out of interface.

	* gash/commands/awk.scm (awk): Move interface-agnostic logic...
	(%eval-awk): ...to this new procedure.

2020-02-10  Timothy Sample  <samplet@ngyro.com>

	Fix typo in README.

	* README (Requirements): Add missing 'on'.

Copyright © 2020 Timothy Sample <samplet@ngyro.com>

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.  This file is offered as-is,
without any warranty.
