<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git/src/poem/read, 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>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 into_iter() for Chars in new next() function</title>
<updated>2024-05-17T22:20:26+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-17T22:20:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=8756d3e7512c1416cc15a688c62b8f51f030b192'/>
<id>8756d3e7512c1416cc15a688c62b8f51f030b192</id>
<content type='text'>
The instance of &amp;mut Chars is already an iterator, so we can remove the
call to into_iter().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The instance of &amp;mut Chars is already an iterator, so we can remove the
call to into_iter().
</pre>
</div>
</content>
</entry>
<entry>
<title>Rewrite of the next! macro</title>
<updated>2024-05-17T22:14:42+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-17T22:14:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=40a403c412be52b713a7363840bfa3f507985a9f'/>
<id>40a403c412be52b713a7363840bfa3f507985a9f</id>
<content type='text'>
This patch replaces the next! macro with a next() function. It serves
the same purpose, but instead of only checking for two different
runes (a fallback, or one that matches the peek), it can now take a list
of runes/characters to look ahead for, in addition to the fallback.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces the next! macro with a next() function. It serves
the same purpose, but instead of only checking for two different
runes (a fallback, or one that matches the peek), it can now take a list
of runes/characters to look ahead for, in addition to the fallback.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix regression with aliases</title>
<updated>2024-05-13T05:53:57+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-13T05:53:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=908cd899695ba07bfc47645c532337958ee208d7'/>
<id>908cd899695ba07bfc47645c532337958ee208d7</id>
<content type='text'>
Fixed a regression that was introduced in:
1415c8f9b89699000ef8d864ff8f0e1bebca4a5f.

Moving aliases to read() broke how pipes worked. This commit removes the
troublesome append!() macro, and replaces it with some logic in the
add() function (impl Appendable for Poem).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed a regression that was introduced in:
1415c8f9b89699000ef8d864ff8f0e1bebca4a5f.

Moving aliases to read() broke how pipes worked. This commit removes the
troublesome append!() macro, and replaces it with some logic in the
add() function (impl Appendable for Poem).
</pre>
</div>
</content>
</entry>
<entry>
<title>Add 'strings' to the verse after the string!() macro</title>
<updated>2024-04-07T05:50:46+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-04-07T05:50:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=6198c54a9e1155bb9b7f93b8cb5daf3e2deddb25'/>
<id>6198c54a9e1155bb9b7f93b8cb5daf3e2deddb25</id>
<content type='text'>
This patches fixes a bug, where sometimes, when a Rune::String was
detected, the resulting string from the string!() macro wasn't getting
pushed to the current verse.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patches fixes a bug, where sometimes, when a Rune::String was
detected, the resulting string from the string!() macro wasn't getting
pushed to the current verse.
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle aliases in read()</title>
<updated>2024-04-05T04:12:14+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-04-05T04:12:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=1415c8f9b89699000ef8d864ff8f0e1bebca4a5f'/>
<id>1415c8f9b89699000ef8d864ff8f0e1bebca4a5f</id>
<content type='text'>
Instead of handling aliases in the recite() function, which requires two
loops to handle properly with the current implementation, offload
checking for aliases to the read() function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of handling aliases in the recite() function, which requires two
loops to handle properly with the current implementation, offload
checking for aliases to the read() function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't interpret environment variables in single quoted strings</title>
<updated>2024-03-31T06:14:46+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-03-31T06:14:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=f03f4e0fcf62c9b3267bc5d8b62068d89ec593cd'/>
<id>f03f4e0fcf62c9b3267bc5d8b62068d89ec593cd</id>
<content type='text'>
Previously, if an environment variable was given in a string, such as:
'$PATH' or "$PATH", both would be replaced with the value of $PATH from
the environment. However, for single quotes strings, any values inside
should be taken at face value. In other words, echo '$PATH' should
simply write out: $PATH, and not whatever environment value $PATH
happens to be. This patch replaced '$' in single quoted strings with
the ASCII shift out (x0e) character. Any ASCII SO placeholder is
replaced with a '$' in recite(), after the environment variables have
been accounted for.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, if an environment variable was given in a string, such as:
'$PATH' or "$PATH", both would be replaced with the value of $PATH from
the environment. However, for single quotes strings, any values inside
should be taken at face value. In other words, echo '$PATH' should
simply write out: $PATH, and not whatever environment value $PATH
happens to be. This patch replaced '$' in single quoted strings with
the ASCII shift out (x0e) character. Any ASCII SO placeholder is
replaced with a '$' in recite(), after the environment variables have
been accounted for.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add comments (`#`) to the parser</title>
<updated>2024-03-29T03:01:49+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-03-29T03:01:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=527cc04ffb9ea627ca678fe8fb07fe9330420eab'/>
<id>527cc04ffb9ea627ca678fe8fb07fe9330420eab</id>
<content type='text'>
The parser will now interpret the '#' character as a single-line comment
string, which works on it's own line, or at the end of an existing line.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The parser will now interpret the '#' character as a single-line comment
string, which works on it's own line, or at the end of an existing line.
</pre>
</div>
</content>
</entry>
<entry>
<title>read() and recite() overhaul</title>
<updated>2024-03-23T08:45:54+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-03-23T08:45:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=5a7718698373d07a29fffcb792acdb81aa7712d7'/>
<id>5a7718698373d07a29fffcb792acdb81aa7712d7</id>
<content type='text'>
Rebuilt the LR parser (i.e. read()) from the ground up. This required
that some changes be made to recite(), in order to accomodate the new
data structures. These data structures were each split out into their
own file, in order to make working with each component a bit easier.

In addition to reworking the parts of the parser already present, some
new features were also added, such as:
  - Support for strings (' and ")
  - Support for environment variables ($)
  - Support for interpreting tild as $HOME (~)
  - Support for sub-reading and sub-reciting (`)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rebuilt the LR parser (i.e. read()) from the ground up. This required
that some changes be made to recite(), in order to accomodate the new
data structures. These data structures were each split out into their
own file, in order to make working with each component a bit easier.

In addition to reworking the parts of the parser already present, some
new features were also added, such as:
  - Support for strings (' and ")
  - Support for environment variables ($)
  - Support for interpreting tild as $HOME (~)
  - Support for sub-reading and sub-reciting (`)
</pre>
</div>
</content>
</entry>
</feed>
