Skip to content

patches from ELPA#60

Merged
zkry merged 3 commits intomasterfrom
scratch/yaml
Feb 8, 2025
Merged

patches from ELPA#60
zkry merged 3 commits intomasterfrom
scratch/yaml

Conversation

@zkry
Copy link
Owner

@zkry zkry commented Feb 8, 2025

No description provided.

* yaml.el (yaml--parse-from-grammar): Hoist all the
`(setq res` outside of the `pcase` and consolidate them.
Comparing symbols is much faster (pointer equality) than comparing
strings, so use parse state symbols everywhere instead of their names.

This requires changing the parse tree format for those nodes that have
a "grammar-events-in/out": Instead of (STATE-NAME PARSE-STRING ...)
we now use (PARSE-STRING STATE-SYMBOL ...) so that
`(stringp (car tree))` can still be used to detect them.

* yaml.el (yaml--tracing-ignore, yaml--grammar-resolution-rules)
(yaml--grammar-events-in, yaml--grammar-events-out)
(yaml--terminal-rules): Use symbols rather than strings for parser states.
(yaml--state): Document the `state` slot's type as a symbol.
(yaml--state-set-m): Fix docstring.
(yaml--walk-events): Adjust to new parse-tree format.
(yaml--set): Compare the symbols rather than their names.
(yaml--parse-from-grammar): Use the state symbol where we used its name.
Adjust the format of the returned parse tree.
@zkry zkry merged commit f2c202a into master Feb 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants