- evaltest.TestTranscriptsInFS runs transcripts in .elv and .elvts files as
tests.
- Extend the syntax of Elvish transcripts with headings and comments; the former
is used to split a single .elvts file into multiple sessions.
*Exception.Show used to work differently when the traceback contains one frame
vs more frames. Harmonize how they work, and consistent with how parse errors
and compilation errors are shown.
- Change Context to export all its fields.
- Include end position in Context, and include it in Show.
- Remove the Type field from Error, and express it using an ErrorTag type
parameter instead.
- Make {Pack Unpack}CognateErrors type-safe with the new ErrorTag mechanism, and
rename them to just {Pack Unpack}Errors.
- Use reflection to derive function name.
- Take test cases as variadic arguments, instead of requiring them to be wrapped
in a Table.
- Support naming test cases.
- Run test cases as subtests with t.Run.
Instead of having each individual module embed their .elv files and collect all
of them in pkg/mods/doc, have a single embed.FS at pkg that includes everything,
and use that pkg/mods/doc.
Implement a function that extracts all module elvdocs, and put it in pkg/elvdoc.
Also rename &posix to &sep-posix, and add &sep-longest.
The original eawk name is documented as deprecated but doesn't emit deprecation
warnings during compilation yet; this will be fixed in the next commit.
One of the biggest pain points of using elvish
as a shell in practice has been parsing output from
shell commands that return text.
Many CLIs are parseable by AWK. This commit
adds the AWK separator argument to eawk,
which should make it easier to parse the
output of many shell commands.
Most of the symbols moved originate from Go's os package. However,
eval-symlink, which is provided by Go's path/filepath package, is also moved to
the os: module since it requires actual filesystem access. The idea is that
Elvish's path: will only provide functionalities for lexically manipulating
file paths without referencing the actual filesystem, akin to Python's
pathlib.PurePath.
The old symbols in path: are not formally deprecated since the compiler can't
statically check symbols in modules yet.
Now that pipe is a structmap and structmaps are considered indistinguishable to
normal maps, IO redirection should support arbitrary maps too.
Update the relevant section in the language spec and rewrite it a bit.
Struct map is a mechanism to let Go code expose simple structs to Elvish code.
The difference between struct maps and maps is convenience for Go code; they
also have different performance characteristics, but since struct maps are
always quite small, the difference is not meaningful for Elvish's use cases.
As a result, there is no good reason that Elvish code needs to be aware of the
difference between struct maps and normal maps. Making them indistinguishable to
Elvish code simplifies the language.
This commit does the following:
- Change Equal, Hash, Kind and Repr to treat struct maps like maps.
- Change Assoc and Dissoc to "promote" struct maps to maps.
- Remove the custom Repr method of parse.Source.
- Update documentation to reflect this change.
Previously Go's == was used to test for equality when the container is not a
map, which is more strict when Elvish's normal equality test. For example,
"has-value [[foo]] [foo]" used to output false, rather than the expected true.