<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git/src/poem/elements, branch v0.0.1</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>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>
<entry>
<title>Update the return value of Verse::spellcheck()</title>
<updated>2024-05-21T05:52:37+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-21T05:52:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=85a3bd273e927b8dc31aadf263b93ef8fd3b7a39'/>
<id>85a3bd273e927b8dc31aadf263b93ef8fd3b7a39</id>
<content type='text'>
Instead of returning true or false, if a given bin is found on the
$PATH, return the index of where the bin was found. This is useful, in
case we want to actually get the full path of the bin.

If a full or relative path is specified, the function will return the
length of the bins vector.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of returning true or false, if a given bin is found on the
$PATH, return the index of where the bin was found. This is useful, in
case we want to actually get the full path of the bin.

If a full or relative path is specified, the function will return the
length of the bins vector.
</pre>
</div>
</content>
</entry>
<entry>
<title>Updated/added doc comments for the Verse element</title>
<updated>2024-05-20T20:37:25+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-20T20:37:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=e06d529c3a9624f7d5db2b0054f88af6062757cc'/>
<id>e06d529c3a9624f7d5db2b0054f88af6062757cc</id>
<content type='text'>
Added definitions of fields for the Verse struct, and updated its
wording to accomodate for the type change of the couplet field.

Updated the wording of Verse::add() to make it more verbose, and also
added descriptions of the arguments, alongside some example usage.

Added documentation comments for the Verse::incant() function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added definitions of fields for the Verse struct, and updated its
wording to accomodate for the type change of the couplet field.

Updated the wording of Verse::add() to make it more verbose, and also
added descriptions of the arguments, alongside some example usage.

Added documentation comments for the Verse::incant() function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update doc comments for Runes</title>
<updated>2024-05-20T20:11:48+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-20T20:11:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=2d4f347d217e31d6685d52eca1657a5020e92c56'/>
<id>2d4f347d217e31d6685d52eca1657a5020e92c56</id>
<content type='text'>
Added documentation comments for the new Runes that help with handling
file redirection of STDERR.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added documentation comments for the new Runes that help with handling
file redirection of STDERR.
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't clear 'out' unconditionally</title>
<updated>2024-05-20T06:17:01+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-20T06:17:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=1bb25591b77a14a17bd05d79316ce703bcbcc3a6'/>
<id>1bb25591b77a14a17bd05d79316ce703bcbcc3a6</id>
<content type='text'>
Only clear the 'out' vector when the verse is not a couplet, otherwise
text will not be piped to the next verse in the poem.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only clear the 'out' vector when the verse is not a couplet, otherwise
text will not be piped to the next verse in the poem.
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle STDERR, in addition to STDOUT</title>
<updated>2024-05-20T00:50:06+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-20T00:50:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=4b1b8061e79b42128df4f06fd1e439549bf9696b'/>
<id>4b1b8061e79b42128df4f06fd1e439549bf9696b</id>
<content type='text'>
This patch overhauls the reading and reciting of verses, such that the
redirection of STDERR (in addition to STDOUT, which was already a
feature), is now possible.

Removed the 'stdout' argument from recite(), since it is no longer
needed with how incantations function.

A verse's couplet indicator is now a u8, instead of a bool, with certain
values corresponding to types of couplets, for instance:

  ls | grep Ca | lolcat
  ^    ^         ^
  |    |         2: right side of a couplet
  |    3: both sides of a couplet
  1: left side of a couplet

Incantions are no longer hanlded in rune.rs, and the task macros have
been removed. Now, a verse incants itself, matching on its own meter to
determine how to handle the next verse.

The following runes were added to help with handling STDERR:
  Write2 -&gt; 2&gt;
  WriteAll -&gt; &amp;&gt;
  Addendum2 -&gt; 2&gt;&gt;
  AddendumAll -&gt; &amp;&gt;&gt;

The 'io' field in verse was changed from an Option&lt;Rune&gt;, to an array of
Runes, since a single verse might have multiple IO operations.

The following fields were added to Verse, to assist with handling
STDERR:
  ip -&gt; List of filenames to read into STDIN
  op -&gt; List of filenames to send STDOUT to
  ep -&gt; List of filenames to send STDERR to

Keep track of channels when reading a poem. Channels are relating to IO
operations. If channel is None, words get pushed to the verse's primary
stanza (i.e. the verb or the clause). If a channel is selected, words
are pushed to one of the aforementioned new fields in Verse.
  Read -&gt; ip
  Write/Addedum -&gt; op
  Write2/Addedum2 -&gt; ep
  WriteAll/AddendumAll -&gt; op and ep
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch overhauls the reading and reciting of verses, such that the
redirection of STDERR (in addition to STDOUT, which was already a
feature), is now possible.

Removed the 'stdout' argument from recite(), since it is no longer
needed with how incantations function.

A verse's couplet indicator is now a u8, instead of a bool, with certain
values corresponding to types of couplets, for instance:

  ls | grep Ca | lolcat
  ^    ^         ^
  |    |         2: right side of a couplet
  |    3: both sides of a couplet
  1: left side of a couplet

Incantions are no longer hanlded in rune.rs, and the task macros have
been removed. Now, a verse incants itself, matching on its own meter to
determine how to handle the next verse.

The following runes were added to help with handling STDERR:
  Write2 -&gt; 2&gt;
  WriteAll -&gt; &amp;&gt;
  Addendum2 -&gt; 2&gt;&gt;
  AddendumAll -&gt; &amp;&gt;&gt;

The 'io' field in verse was changed from an Option&lt;Rune&gt;, to an array of
Runes, since a single verse might have multiple IO operations.

The following fields were added to Verse, to assist with handling
STDERR:
  ip -&gt; List of filenames to read into STDIN
  op -&gt; List of filenames to send STDOUT to
  ep -&gt; List of filenames to send STDERR to

Keep track of channels when reading a poem. Channels are relating to IO
operations. If channel is None, words get pushed to the verse's primary
stanza (i.e. the verb or the clause). If a channel is selected, words
are pushed to one of the aforementioned new fields in Verse.
  Read -&gt; ip
  Write/Addedum -&gt; op
  Write2/Addedum2 -&gt; ep
  WriteAll/AddendumAll -&gt; op and ep
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove some defunct code</title>
<updated>2024-05-04T22:38:17+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-04T22:38:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=9b4785ce4f89ea50c00459f260f4a00050a6a48a'/>
<id>9b4785ce4f89ea50c00459f260f4a00050a6a48a</id>
<content type='text'>
Remove some defunct code that was previously used to check for special
runes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove some defunct code that was previously used to check for special
runes.
</pre>
</div>
</content>
</entry>
</feed>
