configury: regenerate .gitmodules.

* .gitmodules: Regenerate.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specs: begin adding specl specs.

A very basic start at speccing out behaviour of larch, and fix
a couple of bugs already turned up by the initial specs!
* specs/specs.mk: New file.  Hook spec checks into `make check`.
* specs/main_spec.yaml: New file.  Initial command line behaviour
specs for larch.
* lib/larch/main.lua (optspec): Add missing 'Options:' marker.
(execute): Ensure unrecognised options are diagnosed.
* bin/larch: Regenerate.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
refactor: remove local slurp.

Now that we depend on stdlib for objects and option parsing,
there's no reason to carry a local 'slurp' function.
* lib/larch/main.lua: Import slurp from std.io.
(slurp): Remove.
* bin/larch: Regenerate.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
refactor: move spec setup to separate spec_helper.lua file.

* specs/main_spec.yaml (before): Move from here...
* specs/spec_helper.lua: New file. ...to here, and adjust.
* specs/specs.mk (EXTRA_DIST): Add specs/spec_helper.lua.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specs: use specl-11 inprocess spec examples.

* bootstrap.conf (buildreq): Add specl-11.
* lib/larch/loader.lua: Fix many breakages that prevented this
from working at all.
* lib/larch/main.lua: Add `inprocess` field to returned object,
per specl-11 interface.
* specs/spec_helper.lua: Use larch.loader.expand loader to
dynamically expand `from ... import` macros in larch.main during
`require`.
(larch): Use Main object for `specl.inprocess` loading without
fork.
(spawn): New function.  Based on previous revision's larch
function.
* specs/main_spec.yaml: Use `spawn` to specify config substituted
`--help` and `--version` output, otherwise new `inprocess` larch
invocations.
* bin/larch: Regenerate.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
larch: support multiple occurrences of `--evaluate`.

* specs/main_spec.yaml: Specify behaviour of `--evaluate` switch.
* lib/larch/main.lua (execute): Support multiple uses of
`--evaluate` on a single invocation.
* bin/larch: Regenerate.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specs: add rudimentary from macro specifications.

* specs/from_spec.yaml: New file.  Add basic functionality specs.
* specs/spec_helper.lua (macro): Load expander and macros.
* specs/specs.mk (specl_SPECS): Add specs/from_spec.yaml.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
from: ensure from only expands before another identifier.

* specs/from_spec.yaml: New example with several uses of `from`
as a non-macro.
* lib/larch/from.lua (from): If peek-ahead token is not an
identifier, then pass-through the from token without expansion.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
from: parse specific 'import' and ',' tokens after accepting 'from'.

* specs/from_spec.yaml: Diagnose missing import token.
* lib/larch/from.lua (from): Parse specific 'import' and ','
tokens after accepting 'from'.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
from: with a string argument, also output require statement.

* specs/from_spec.yaml: Specify output for string valued from
argument.
* lib/larch/from.lua (from): Accept a string as the first
argument, and use that as the name of a module to require.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
refactor: generalize mapconcat with a function callback.

* lib/larch/from.lua (mapconcat): Instead of a prefix, take a
callback function to adjust each element.
Also, hardcode a ", " separator.
Adjust all callers.
* specs/from_spec.yaml: More comprehensive specifications.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>