Skip to content

Add KDL v2 syntax support while preserving existing KDL v1 compatibility#18

Open
tassis wants to merge 3 commits into
tree-sitter-grammars:masterfrom
tassis:master
Open

Add KDL v2 syntax support while preserving existing KDL v1 compatibility#18
tassis wants to merge 3 commits into
tree-sitter-grammars:masterfrom
tassis:master

Conversation

@tassis

@tassis tassis commented May 28, 2026

Copy link
Copy Markdown

Add permissive KDL v2 syntax support while preserving existing KDL v1 editor compatibility.

This grammar is intended for editor/tooling use-cases and should not be treated as a strict KDL version validator.

Changes

  • Added KDL v2 boolean and null literals:

    • #true
    • #false
    • #null
  • Added KDL v2 keyword-like numeric literals:

    • #inf
    • #-inf
    • #nan
  • Relaxed spacing in a few places commonly used by KDL v2, including:

    • type annotations
    • properties around =
  • Added support for KDL v2 multiline strings

  • Added support for KDL v2 raw strings such as:

    • #"value"#
    • ##"value"##
      while keeping KDL v1 raw strings such as:
    • r#"value"#

It may successfully parse documents that mix KDL v1 and KDL v2 literal forms.

Notes

This PR used AI assistance for parts of the work, including Unicode-related rewrites, test case generation, and discussions around how to implement KDL v2 specification details.

@tassis tassis force-pushed the master branch 2 times, most recently from f02626f to 2a12271 Compare May 28, 2026 16:44
@tassis tassis changed the title Add KDL v2 compatibility while preserving KDL v1 support Add permissive KDL v2 syntax support while preserving existing KDL v1 editor compatibility May 28, 2026
@tassis tassis changed the title Add permissive KDL v2 syntax support while preserving existing KDL v1 editor compatibility Add KDL v2 syntax support while preserving existing KDL v1 editor compatibility May 28, 2026
@tassis tassis force-pushed the master branch 4 times, most recently from 1fd04a0 to a4f036a Compare May 28, 2026 17:41
@tassis tassis changed the title Add KDL v2 syntax support while preserving existing KDL v1 editor compatibility Add KDL v2 syntax support while preserving existing KDL v1 compatibility May 29, 2026
@tassis tassis force-pushed the master branch 4 times, most recently from ccb8ebb to 43c3f09 Compare May 29, 2026 03:42
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.

1 participant