Feature/scanner/contexts #17
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: dolysis/yary#17
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/scanner/contexts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds support for YAML flow and block contexts, adds a stable min heap Queue, and updates the Scanner to use these.
Components
Scanner.Context
MappingStart
SequenceStart
MappingEnd
SequenceEnd
Entry
Tokens
typedef toQueue<TokenEntry>
Scanner.Key
to save positions in the byte stream as possible Key locationsScanner
broadly to use bothContext
and the refactoredKey
Context
This is another
Scanner
subsystem responsible for tracking the current YAML context (block or flow). Which context you're in changes the rules on what is legal or not, and many indicators are only legal in one or the other -- classic example being block scalars:Which are only allowed in the block context.
Queue
Reposted from my commit message:
4845a83
Refactor of
Key
In order to take advantage of the Queue I modified
Scanner.Key
to instead save the position of a potential key, rather than just if the key is possible. This allows me to later insert the key at the correct buffer position.General chaos in
Scanner
This PR sees a lot of movement in the Scanner code, due to the rearranging, however almost all of it is simple rewrites to use the new functions and not "new code" per-se, outside of calls to
self.context
or theun/roll_indent
functions.