So, the underlying bug here is caused because we check for zero indents
*before* unwinding the indentation stack. Take the following example:
```
0|Map1:
1|- Map2: value
2| Map2.1: value
3|Map3: ...
----------
0123456789
```
At (1,0) we encounter to indentation level increases -- map, sequence --
but zero actual indentation increase until (1,3) ('M' in 'Map2').
So, when we arrive at (3,0), Scanner::unroll_indent/2 only unrolls one
indent level... the second one (sequence) which contains the information
we use to determine whether an indent level has a zero indent that needs
to be added to the queue. Thus, when we hit the call to
Scanner::pop_zero_indent_sequence/2 it looks at the current indent
(map), which it correctly decides isn't zero indented.
The fix is simple, just reorder the operations to check for zero indents
before we unroll.
That said, I probably should create some additional test cases to check
that we handle these edge cases correctly.
1. Zero indent before and after real indent: (Z,N,Z)
2. Double zero indent -- not sure this is possible in YAML (Z,Z)
Issue: #54
Just is an improvement on Make/Makefiles for people that wish to use it
as a recipe runner rather than a build system.
We are introducing a dependency on it, as it gives us easy ways to run
arbitrarily complex commands in a composable fashion.
In particular, these recipes allow us 5 major gains:
1. Setting our repo's environment consistently (fresh-system, install-bins)
2. Run comprehensive checks on the local tree's code (lint, audit, fmt,
test, test-all, lint-docs)
3. Utility commands for inspecting dependencies (deps, rdeps, udeps),
documentation (docs) or git hygiene (git-branch-prune)
4. Provides extra environment vairables that can be used to control
things like features and profile used when building, which are
missing from Cargo and/or rustc
5. Provides a uniform interface for repo tasks, abstracting over many
different underlying tools
This is the first published version of this crate. Quite a milestone for
me, as I have started work on this library multiple times over the last
3 years, never getting enough traction to find something that worked for
my project goals.
This version contains the lowest level API that will be supported by
this crate: lib/event; which allows callers to directly consume YAML
stream events as the occur, with no help or storage apparatus.
I have some CI/CD issues to figure out -- testing docs, automating
crates.io publishes, improving test spread and speed, adding a recipe
runner (Make/just). After which I'll start working away on the in memory
graph representation of YAML, which will allow me to provide a Value
abstraction for handling arbitrary YAML, similar to serde_json::Value.
Its secondary purpose will be as storage for aliasing trees... during
serde::Deserialization, which will be a feature gated API that may
eventually take the place of serde_yaml.
This commit modifies the former Scalar (now know as ScalarLike) enum to
hide the internal types inside local opaque wrappers. Rather than the
previous struct variants, ScalarLike now takes Eager(Scalar) and
Lazy(ScalarLazy) variants, both of which hide internal types involved.
This commit also removes the ScanResult return types from public view,
converting them to the library level Error type.
We place a small wrapper around all of the arguments provided to
Read::drive(), and return a wrapped error, both of which are opaque to
external libraries.
This type obscures the underlying classifications, providing a stable
enum, Category, for classification.
This doesn't particularly change the various module level errors, though
will will have to implement From<Self> for yary::Error.
I'll also need to make private and public versions of the initializer
functions for fallible public methods that can be used internally, e.g
lib/reader.