branch: externals/yaml commit c215bf7a3345abdfdca47f20ab6530ee0380ffd1 Author: Zachary Romero <zacrom...@posteo.net> Commit: Zachary Romero <zacrom...@posteo.net>
add function for generating parse with metadata strings --- yaml.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yaml.el b/yaml.el index 31bf7b24fd..4c057f674e 100644 --- a/yaml.el +++ b/yaml.el @@ -1107,6 +1107,13 @@ value. It defaults to the symbol :false." (length yaml--parsing-input))) res)) +(defun yaml-parse-string-with-pos (string) + "Parse the YAML value in STRING, storing positions as text properties." + (let ((yaml--parsing-store-position t)) + (yaml-parse-string string + :object-type 'alist + :object-key-type 'string))) + (defun yaml--parse-from-grammar (state &rest args) "Parse YAML grammar for given STATE and ARGS.