<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dome-key-map/src, branch master</title>
<subtitle>DomeKey core library</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/'/>
<entry>
<title>Add license</title>
<updated>2018-11-22T03:31:13+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-22T03:31:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=1c1958c40b62c02032ff8b41c6ad38563bb27617'/>
<id>1c1958c40b62c02032ff8b41c6ad38563bb27617</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>map_group(): Fix error when mappings start with comment or whitespace</title>
<updated>2018-11-05T03:29:00+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-05T03:29:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=d608a23da62c9a93c01802997f1204fd494eb97d'/>
<id>d608a23da62c9a93c01802997f1204fd494eb97d</id>
<content type='text'>
Previously we'd get an error if the first lines in the mappings file
were blank or comments.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously we'd get an error if the first lines in the mappings file
were blank or comments.
</pre>
</div>
</content>
</entry>
<entry>
<title>parser: Add tests for initial whitespace and comments in mappings file</title>
<updated>2018-11-05T02:39:50+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-05T02:39:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=2495cd60c34061b4e2b383beee6947787388f4cf'/>
<id>2495cd60c34061b4e2b383beee6947787388f4cf</id>
<content type='text'>
This broke recently I think. You can no longer have a mappings file that
starts with blank lines or comment lines.

Removing the empty and blank handler in `definitions()` fixes the tests
added by this commit but fails these:

    parser::tests::map_group_empty_input_does_not_fail
    parser::tests::map_group_skipped_input_outputs_default_map_group

Using this diff:

    diff --git a/src/parser.rs b/src/parser.rs
    index 3f3d7b9..d18b56a 100644
    --- a/src/parser.rs
    +++ b/src/parser.rs
    @@ -629,11 +629,11 @@ where
         I: Stream&lt;Item = char&gt;,
         I::Error: ParseError&lt;I::Item, I::Range, I::Position&gt;,
     {
    -    or(
    -        (
    -            blank(),
    -            eof(),
    -        ).map(|_| MapGroup::default()),
    +    // or(
    +    //     (
    +    //         blank(),
    +    //         eof(),
    +    //     ).map(|_| MapGroup::default()),
             (
                 definitions(),
                 eof(),
    @@ -661,8 +661,8 @@ where
                 }

                 map_group
    -        }),
    -    )
    +        })
    +    // )
     }

     fn comment&lt;I&gt;() -&gt; impl Parser&lt;Input = I&gt;

Need to figure out some way to get both sets of tests to pass.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This broke recently I think. You can no longer have a mappings file that
starts with blank lines or comment lines.

Removing the empty and blank handler in `definitions()` fixes the tests
added by this commit but fails these:

    parser::tests::map_group_empty_input_does_not_fail
    parser::tests::map_group_skipped_input_outputs_default_map_group

Using this diff:

    diff --git a/src/parser.rs b/src/parser.rs
    index 3f3d7b9..d18b56a 100644
    --- a/src/parser.rs
    +++ b/src/parser.rs
    @@ -629,11 +629,11 @@ where
         I: Stream&lt;Item = char&gt;,
         I::Error: ParseError&lt;I::Item, I::Range, I::Position&gt;,
     {
    -    or(
    -        (
    -            blank(),
    -            eof(),
    -        ).map(|_| MapGroup::default()),
    +    // or(
    +    //     (
    +    //         blank(),
    +    //         eof(),
    +    //     ).map(|_| MapGroup::default()),
             (
                 definitions(),
                 eof(),
    @@ -661,8 +661,8 @@ where
                 }

                 map_group
    -        }),
    -    )
    +        })
    +    // )
     }

     fn comment&lt;I&gt;() -&gt; impl Parser&lt;Input = I&gt;

Need to figure out some way to get both sets of tests to pass.
</pre>
</div>
</content>
</entry>
<entry>
<title>trial: Set a proper encryption key</title>
<updated>2018-11-03T18:41:01+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-03T18:41:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=95284d5ed66f3ae74db4861e0118d4ad2486556b'/>
<id>95284d5ed66f3ae74db4861e0118d4ad2486556b</id>
<content type='text'>
Remove the TODO key and use a real one instead. A description of the
program.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the TODO key and use a real one instead. A description of the
program.
</pre>
</div>
</content>
</entry>
<entry>
<title>parser: Add tests for error message</title>
<updated>2018-11-03T18:04:35+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-03T18:04:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=df366366a1b318b6bc4b00b3829fcd1455d09d97'/>
<id>df366366a1b318b6bc4b00b3829fcd1455d09d97</id>
<content type='text'>
Check that the desired error messages appear for a couple extra invalid
mapping definitions.

Rename the existing `map_group_shows_error_in_middle_of_line()` test to
use the naming pattern of the two new tests.

The new tests check that the right errors appear in map actions, and for
missing the closing brace on a mode definition.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check that the desired error messages appear for a couple extra invalid
mapping definitions.

Rename the existing `map_group_shows_error_in_middle_of_line()` test to
use the naming pattern of the two new tests.

The new tests check that the right errors appear in map actions, and for
missing the closing brace on a mode definition.
</pre>
</div>
</content>
</entry>
<entry>
<title>parser: Remove debug print statement</title>
<updated>2018-11-03T18:03:06+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-03T18:03:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=16d5b3f7c35859c58365a689b94383203497caef'/>
<id>16d5b3f7c35859c58365a689b94383203497caef</id>
<content type='text'>
Just noticed this. Seems it served its purpose.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Just noticed this. Seems it served its purpose.
</pre>
</div>
</content>
</entry>
<entry>
<title>map_group_shows_error_in_middle_of_line: Add unexpected token assertion</title>
<updated>2018-11-03T17:24:27+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-03T17:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=c22e695764a8eb45605712fa3ef1ffe7a5beb1df'/>
<id>c22e695764a8eb45605712fa3ef1ffe7a5beb1df</id>
<content type='text'>
In addition to asserting the position of the error, also check that it's
the error we expect by looking for an unexpected 'n' token.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In addition to asserting the position of the error, also check that it's
the error we expect by looking for an unexpected 'n' token.
</pre>
</div>
</content>
</entry>
<entry>
<title>parser::definitions(): Move `try()` calls to map_kind parsers</title>
<updated>2018-11-03T17:07:37+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-03T17:04:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=e3e0b70d1c7195b460784a333e07019c6b3a19c9'/>
<id>e3e0b70d1c7195b460784a333e07019c6b3a19c9</id>
<content type='text'>
This seems to fix the problem of errors in the middle of definitions not
being surfaced (what the test in
3091ebe0deb1ba832b4a5925263409ec5b651c62 is for).

Need to write some more tests for other error cases.

The reason why this happens is because `try()` causes the parser to not
consume the input. Since the input isn't consumed, I guess the error
messages from within never get surfaced. Moving the `try()` further down
the parser tree appears to fix things.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This seems to fix the problem of errors in the middle of definitions not
being surfaced (what the test in
3091ebe0deb1ba832b4a5925263409ec5b651c62 is for).

Need to write some more tests for other error cases.

The reason why this happens is because `try()` causes the parser to not
consume the input. Since the input isn't consumed, I guess the error
messages from within never get surfaced. Moving the `try()` further down
the parser tree appears to fix things.
</pre>
</div>
</content>
</entry>
<entry>
<title>map_group_shows_error_in_middle_of_line: Fix column number</title>
<updated>2018-11-03T15:22:58+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-03T15:21:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=34a5f3749e7d60855ff907ffa7f66a323454c526'/>
<id>34a5f3749e7d60855ff907ffa7f66a323454c526</id>
<content type='text'>
I wrote the wrong column number on which the error should occur.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I wrote the wrong column number on which the error should occur.
</pre>
</div>
</content>
</entry>
<entry>
<title>map_group_shows_error_in_middle_of_line: Remove errors vec</title>
<updated>2018-11-03T14:34:31+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-03T14:34:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=b6d0d0ec238ecd7a5dd77fc87dea602e102d3fde'/>
<id>b6d0d0ec238ecd7a5dd77fc87dea602e102d3fde</id>
<content type='text'>
Since the errors are going to be different from what's written in the
test expectation, just remove them to correct the test. We kind of only
care about the position. Maybe the first error would be interesting to
match on, but let's just get rid of the part we know is wrong.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the errors are going to be different from what's written in the
test expectation, just remove them to correct the test. We kind of only
care about the position. Maybe the first error would be interesting to
match on, but let's just get rid of the part we know is wrong.
</pre>
</div>
</content>
</entry>
</feed>
