<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git/src/recite, branch gha</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>Fix ps macros doc comments</title>
<updated>2024-02-29T06:04:51+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-29T06:04:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=75407774ce163df53c28391fb653c3714abd1aef'/>
<id>75407774ce163df53c28391fb653c3714abd1aef</id>
<content type='text'>
[Verse] is not in scope for the ps module, so removed the link in the
documentation comments.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Verse] is not in scope for the ps module, so removed the link in the
documentation comments.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add doc comments for ps macros</title>
<updated>2024-02-29T06:02:20+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-29T06:02:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=55e9a27bde60a8e4fbb6306871b6317d68685987'/>
<id>55e9a27bde60a8e4fbb6306871b6317d68685987</id>
<content type='text'>
Added documentation comments for the recite::ps::task and
recite::ps::ctask macros.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added documentation comments for the recite::ps::task and
recite::ps::ctask macros.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove custom errors and fix background forking</title>
<updated>2024-02-27T10:49:01+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-27T10:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=e94d09da9449cabd7ece2acd98d52b1946a922a4'/>
<id>e94d09da9449cabd7ece2acd98d52b1946a922a4</id>
<content type='text'>
Removes the custom errors in src/recite/erro.rs, and replaces them with
std::io::Errors throughout (recite(), incant_, macros).

Fixed a bug with the way forking to the background is handled, where
registering the signal handler in main for all processes would break
couplets (i.e. pipes). Instead, this sets up a new signal handler each
time a process is forked into the background. It uses a Vec&lt;i32&gt; to keep
track of all the background processes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Removes the custom errors in src/recite/erro.rs, and replaces them with
std::io::Errors throughout (recite(), incant_, macros).

Fixed a bug with the way forking to the background is handled, where
registering the signal handler in main for all processes would break
couplets (i.e. pipes). Instead, this sets up a new signal handler each
time a process is forked into the background. It uses a Vec&lt;i32&gt; to keep
track of all the background processes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup recite(), custom errors, fixed forking</title>
<updated>2024-02-27T06:14:13+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-27T06:14:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=0548e74cb3227716cf445f27bd64b8c0b4d0f981'/>
<id>0548e74cb3227716cf445f27bd64b8c0b4d0f981</id>
<content type='text'>
First off, moved the giant match statements out of recite(), and into
macros in src/recite/ps.rs. There still needs to be two, since any verse
using the 'couplet' meter will need to redirect its STDOUT. Now the
recite() function returns a Result&lt;(), Mishap&gt;, which can be invoked
when calling the incant_ functions.

Custom errors were added in the form of 'Mishap''s. They are intended to
be returned from the incant_ functions, in the event that something goes
wrong with the Command::spawn() or Child::wait(). They each take a
String, which should be the verb or stanza that was entered by the user.

The incant_ functions separate the functionality of each type of meter
from the recite() function. They return a Result&lt;i32, Mishap&gt;, where
i32 is the exit code of the program that ran, and Mishap is a possible
error.

Before, the shell was cheating at forking a process to the background.
It would actually spawn a thread to wait for that process to finish.
Now, the program simply registers a handler for SIGCHLD, and uses libc's
waitpid() function to reap the child process, and print some output to
the user, indicating that it's finished.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
First off, moved the giant match statements out of recite(), and into
macros in src/recite/ps.rs. There still needs to be two, since any verse
using the 'couplet' meter will need to redirect its STDOUT. Now the
recite() function returns a Result&lt;(), Mishap&gt;, which can be invoked
when calling the incant_ functions.

Custom errors were added in the form of 'Mishap''s. They are intended to
be returned from the incant_ functions, in the event that something goes
wrong with the Command::spawn() or Child::wait(). They each take a
String, which should be the verb or stanza that was entered by the user.

The incant_ functions separate the functionality of each type of meter
from the recite() function. They return a Result&lt;i32, Mishap&gt;, where
i32 is the exit code of the program that ran, and Mishap is a possible
error.

Before, the shell was cheating at forking a process to the background.
It would actually spawn a thread to wait for that process to finish.
Now, the program simply registers a handler for SIGCHLD, and uses libc's
waitpid() function to reap the child process, and print some output to
the user, indicating that it's finished.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reorganization and comments</title>
<updated>2024-02-23T06:12:24+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-02-23T06:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=536e250653e5c140a6d9e60f1cd652b79135e7a6'/>
<id>536e250653e5c140a6d9e60f1cd652b79135e7a6</id>
<content type='text'>
Broke out the structs for a poem into their own file: src/recite.rs.
Also put the 'prefresh' function into it's own file: src/recite/path.rs.
Commented most of the parser code (including structs and helper methods
related to parsing (i.e. Verse, Stanza, Meter, Poem)). Renamed any
instance of the 'paths' variable to 'path'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Broke out the structs for a poem into their own file: src/recite.rs.
Also put the 'prefresh' function into it's own file: src/recite/path.rs.
Commented most of the parser code (including structs and helper methods
related to parsing (i.e. Verse, Stanza, Meter, Poem)). Renamed any
instance of the 'paths' variable to 'path'.
</pre>
</div>
</content>
</entry>
</feed>
