-
-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KDL 2.0.0 support #3891
Comments
Very cool! The meticulous work on backwards compatibility is very much appreciated. I'm looking forward to seeing this implemented. Incidentally, some really nice related work from our community: https://github.com/dj95/kdl-fmt |
Unless someone claims this soon, I’ll probably give this an initial pass. It shouldn’t be much effort. One thing that’s going to be interesting is what the errors should be: most people out there will likely be on v1 for a while, until docs, defaults, etc get updated. But the kdl-rs fallback mechanism only prints v2 errors if both formats fail (which would be the case in a truly malformed v1 file, for example). I might want to poke at kdl-rs and make the fallback a bit more heuristic: that is, if both fail, do a quick scan of the document for “hints”, like unprefixed keywords, triple quotes, unquoted strings, or even the optional I might do that first, actually tbh. (to clarify, this applies only when both versions fail to parse, and is only meant to improve error messages. It has no effect on parsing documents that are correct in v1, v2, or both) |
KDL 2.0.0 has been released!
Along with this new spec release, I've released
[email protected]
, which supports both KDL 1.0.0 and KDL 2.0.0, and is able to translate document text between both versions.This means that zellij would not need to change much to add 2.0.0 support, except update some
KdlValue
-related API calls/match
es, since that enum has changed.If the
v1-fallback
feature is enabled, you would even be able to smoothly support both v2 and v1, safely, since both versions are unambiguously parseable. You can even convert v1 docs to v2 docs automatically, and vice-versa!kdl-rs
's 2.0 parser is able to collect many syntax errors in a single pass, and so can give richer error messages than either the 1.0 parser (for now).Always happy to answer questions! I hope this is useful to y'all!
The text was updated successfully, but these errors were encountered: