-
Notifications
You must be signed in to change notification settings - Fork 876
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly parse multi-document yaml files
Properly parse multi-document yaml files e.g. blocks separated by ---. This is easily handled by lyaml itself--you just need to pass the option all = true to yaml.load, and each document will be provided as a table. This does break the table iteration a bit, so some more refactoring: - Create a load_state table that holds context like the current - document index, the required_engine_version, etc. - Pull out the parts that parse a single document to load_rules_doc(), which is given the table for a single document + load_state. - Simplify get_orig_yaml_obj to just provide a single row index and - return all rows from that point to the next blank line or line starting with '-' Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
- Loading branch information
Showing
1 changed file
with
96 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters