<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git/src/poem, branch main</title>
<subtitle>a (mostly) posix compliant shell and tiny functional programming language
</subtitle>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/'/>
<entry>
<title>Rewrite of the buffer code + proper UTF-8 support</title>
<updated>2024-12-13T01:05:00+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-12-13T00:59:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=fa9ec0c377305126f4c810be198bdca68d71a275'/>
<id>fa9ec0c377305126f4c810be198bdca68d71a275</id>
<content type='text'>
This patch rewrites much of the code in src/buffer.rs to (utlimately),
be less buggy. It also changed getchar() to have proper support for
UTF-8 characters. The autocomplete function was also enhanced to support
completions with filenames that have spaces in their paths. It handles
these by placing a backslash ('\') before each space in the filename.
There is not yet any completion support with quote ('), nor double-quote
characters ("). The buffer is still navigable with arrow keys, so
arbitrary deletions and insertions are still possible. Deletions and
insertions with multi-width UTF-8 characters work as expected.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch rewrites much of the code in src/buffer.rs to (utlimately),
be less buggy. It also changed getchar() to have proper support for
UTF-8 characters. The autocomplete function was also enhanced to support
completions with filenames that have spaces in their paths. It handles
these by placing a backslash ('\') before each space in the filename.
There is not yet any completion support with quote ('), nor double-quote
characters ("). The buffer is still navigable with arrow keys, so
arbitrary deletions and insertions are still possible. Deletions and
insertions with multi-width UTF-8 characters work as expected.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for inline environment variables</title>
<updated>2024-09-29T01:54:50+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-28T20:57:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=243a8c53ae03713b3d6b4f5bf82859f9c93be6ed'/>
<id>243a8c53ae03713b3d6b4f5bf82859f9c93be6ed</id>
<content type='text'>
This patch adds the 'Notes' rune (`=`), which allows for passing
environment variables, inline, to a binary, like so:

  EDITOR=vim sudo visudo

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the 'Notes' rune (`=`), which allows for passing
environment variables, inline, to a binary, like so:

  EDITOR=vim sudo visudo

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor Verse::clause()</title>
<updated>2024-09-03T04:35:15+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-03T04:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=97ca3fa5197599ec28b19d5b2048f7c24e4c8bbc'/>
<id>97ca3fa5197599ec28b19d5b2048f7c24e4c8bbc</id>
<content type='text'>
There is no reason to return an option for clause(), since it makes us
perform a match twice, and since a blank vector is perfectly acceptable
in all cases where the verse at hand may not have a clause.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no reason to return an option for clause(), since it makes us
perform a match twice, and since a blank vector is perfectly acceptable
in all cases where the verse at hand may not have a clause.

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow escaping characters</title>
<updated>2024-09-02T07:00:26+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-09-01T10:26:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=5c29835f70178e64daeae9b82111fe31376f6f35'/>
<id>5c29835f70178e64daeae9b82111fe31376f6f35</id>
<content type='text'>
This patch adds the '\' character as a new rune, Rune::Special. This is
for escaping special characters. Also works in strings (", ').

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the '\' character as a new rune, Rune::Special. This is
for escaping special characters. Also works in strings (", ').

Signed-off-by: Rory Dudley &lt;rory@netc.lu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a bug with channels</title>
<updated>2024-07-08T22:00:19+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-07-08T22:00:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=13406827a6f13be62659cdb6dcaf3504b5e6210b'/>
<id>13406827a6f13be62659cdb6dcaf3504b5e6210b</id>
<content type='text'>
When using IO operations from within a file, the channel would get
overriden before pushing a filename to the appropriate vector (op, ep,
or both). This is because Rune::Continue is used for newlines, and was
resetting the channel to None, before the push operation. Rune::Continue
is now broken out into its own match clause, that doesn't set the
channel before calling verse.add().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using IO operations from within a file, the channel would get
overriden before pushing a filename to the appropriate vector (op, ep,
or both). This is because Rune::Continue is used for newlines, and was
resetting the channel to None, before the push operation. Rune::Continue
is now broken out into its own match clause, that doesn't set the
channel before calling verse.add().
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a bug with environment variables in the shell</title>
<updated>2024-07-03T21:23:54+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-07-03T21:23:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=af66f66f9d7b4a977ffd2420211704c050f23da8'/>
<id>af66f66f9d7b4a977ffd2420211704c050f23da8</id>
<content type='text'>
The code to find and replace environment variables was only searching
for alphanumeric characters. This means that the shell was unable to
recognize environment variables that used an underscore, for instance.
This patch allows the underscore character to be used when settings and
reading environment variables.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code to find and replace environment variables was only searching
for alphanumeric characters. This means that the shell was unable to
recognize environment variables that used an underscore, for instance.
This patch allows the underscore character to be used when settings and
reading environment variables.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add/update doc comments</title>
<updated>2024-07-01T02:09:26+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-07-01T02:09:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=b8338719e2cc2138bc67c10ad56fb707f5e3b546'/>
<id>b8338719e2cc2138bc67c10ad56fb707f5e3b546</id>
<content type='text'>
This patch update a ton of the documentation comments throughout the
codebase, refactoring some areas, and adding new comments to others.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch update a ton of the documentation comments throughout the
codebase, refactoring some areas, and adding new comments to others.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix capturing output for internal poems</title>
<updated>2024-06-21T19:40:49+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-06-21T19:40:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=e23e4a036008a6f3a3356d48434615a05dcc17e0'/>
<id>e23e4a036008a6f3a3356d48434615a05dcc17e0</id>
<content type='text'>
Sometime when the switch to the new built-in command system was
happening, we lost the logic to force the capture the output of STDOUT,
mainly used for running internal poems (i.e. 'ls `ls`'). This patch adds
a new field to the Environment struct, called fc (force capture). It
gets set to true before running internal poems, and unset afterwards.
Finally, some checks were added to the incant!() macro to properly
handle STDOUT when fc is set.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometime when the switch to the new built-in command system was
happening, we lost the logic to force the capture the output of STDOUT,
mainly used for running internal poems (i.e. 'ls `ls`'). This patch adds
a new field to the Environment struct, called fc (force capture). It
gets set to true before running internal poems, and unset afterwards.
Finally, some checks were added to the incant!() macro to properly
handle STDOUT when fc is set.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add back spellcheck</title>
<updated>2024-06-15T00:29:32+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-06-15T00:29:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=fedd4c31b0d1c6d036b1105a74b6e6a1f135f2b4'/>
<id>fedd4c31b0d1c6d036b1105a74b6e6a1f135f2b4</id>
<content type='text'>
This commit reworks spellcheck() so it is more verbose about what it
returns. It also re-introduces the use of spellcheck() in
Poem::recite().

Spellcheck now returns a value in the enum, Spelling:
  FullPath -&gt; Indicates a full path was specified as the verb
  OnPath -&gt; Indicates the verb is on the $PATH
  BuiltIn -&gt; Indicates the verb is a built-in command
  None (Option) -&gt; The verb does not exist

This commit also removes some defunct (commented-out) code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit reworks spellcheck() so it is more verbose about what it
returns. It also re-introduces the use of spellcheck() in
Poem::recite().

Spellcheck now returns a value in the enum, Spelling:
  FullPath -&gt; Indicates a full path was specified as the verb
  OnPath -&gt; Indicates the verb is on the $PATH
  BuiltIn -&gt; Indicates the verb is a built-in command
  None (Option) -&gt; The verb does not exist

This commit also removes some defunct (commented-out) code.
</pre>
</div>
</content>
</entry>
<entry>
<title>Updated the way built-in commands are called/used</title>
<updated>2024-06-04T22:25:32+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-06-04T22:25:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=c4cd1e2c165c4f34ebf67fa9350f8732b2aeca13'/>
<id>c4cd1e2c165c4f34ebf67fa9350f8732b2aeca13</id>
<content type='text'>
Previously, built-in commands were fairly primitive, merely outputting
STDOUT and STDERR with the print! macros. However, we need them to
behave like normal programs, that is:

  - Acknowledge their verse's meter (forking, piping, etc.),
  - Ability to capture STDOUT and STDERR (&gt;, 2&gt;),
  - and Affect the currently running environment.

For these reasons, the anthology was reworked, and now contains the
Anthology struct, which mimics both std::process::{Child, Command}.

The AnthologyStdin helper struct was also created, for built-ins to
take input on STDIN, though no built-in is currently using it.

Each built-ins' incant functions were updated to return a
std::process::Output. It contains output from STDOUT, output from
STDERR, and the exit code of the "process".

A fix was also implemented for aliases, where the STDOUT and STDERR
vectors were not being copied to the newly constructed verse.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, built-in commands were fairly primitive, merely outputting
STDOUT and STDERR with the print! macros. However, we need them to
behave like normal programs, that is:

  - Acknowledge their verse's meter (forking, piping, etc.),
  - Ability to capture STDOUT and STDERR (&gt;, 2&gt;),
  - and Affect the currently running environment.

For these reasons, the anthology was reworked, and now contains the
Anthology struct, which mimics both std::process::{Child, Command}.

The AnthologyStdin helper struct was also created, for built-ins to
take input on STDIN, though no built-in is currently using it.

Each built-ins' incant functions were updated to return a
std::process::Output. It contains output from STDOUT, output from
STDERR, and the exit code of the "process".

A fix was also implemented for aliases, where the STDOUT and STDERR
vectors were not being copied to the newly constructed verse.
</pre>
</div>
</content>
</entry>
</feed>
