Skip to content

Idea For Fixing #168#169

Draft
abdelkadouss wants to merge 2 commits into
kdl-org:mainfrom
abdelkadouss:main
Draft

Idea For Fixing #168#169
abdelkadouss wants to merge 2 commits into
kdl-org:mainfrom
abdelkadouss:main

Conversation

@abdelkadouss

@abdelkadouss abdelkadouss commented Jun 3, 2026

Copy link
Copy Markdown

PR summary

You mentioned in #168 that you're going to rewrite/refactor the v1 parser in this lib directly instead of depending on an older version of kdl. I think this is going to be a big effort and make significant overhead. What I'd recommend instead is to have only one parser that supports both v1 and v2. This will, insha'Allah, remove a big chunk of code and then it's going to be easier to maintain and develop, insha'Allah. And it's easier to implement in the first place. All you have to do is just add some code in the parser_v2 parse functions to do things differently for v1. For example, for keywords, I've made an example for that in this PR. Make sure to check all the NOTE(mantainer) and TODO(mantainer) comments in the code.

Progress

  • Complete Glue the code after changes — I just became too tired of Glueing so I gave up (maybe this is a skill issue).
  • Complete implementing edits to the parse functions to support v1 (when v1 feature is enabled).
  • Test — write new tests for v1 (or move them from v1_parser if possible).
  • Rename v2_parser to v1_parser.
  • Remove the v1_parser and all related code.

Note about the PR state and purpose

This is not a fix; this is just a starting point. I just want to give you an idea of how you can fix this issue, not fix it myself. This PR is not mergeable as-is, and I'm not saying to complete it (though you can if you find it useful). But you can get the idea and then make your own PR (or just overwrite this one).

@zkat

zkat commented Jun 3, 2026

Copy link
Copy Markdown
Member

Is this authored by an LLM?

@abdelkadouss

abdelkadouss commented Jun 3, 2026

Copy link
Copy Markdown
Author

Is this authored by an LLM?

If u mean the code, NOPE AT ALL. the PR message yes becuse i have an english issue.

@abdelkadouss

Copy link
Copy Markdown
Author

I've spent half the day on this

@zkat

zkat commented Jun 3, 2026

Copy link
Copy Markdown
Member

Just checking! Thank you. I wanted to make sure the anti-LLM AGENTS.md was doing its job :)

@abdelkadouss

abdelkadouss commented Jun 3, 2026

Copy link
Copy Markdown
Author

@zkat What u think?, did u acsepte the idea?, r u gonna insha'Allah impl the new parser this way?.

@zkat

zkat commented Jun 3, 2026

Copy link
Copy Markdown
Member

I'm not entirely sure how this approach would really work? v1 and v2 are very different in a lot of ways, parser-wise. I don't think you'll find much benefit in just parameterizing the KdlVersion like this...

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