Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package tree-sitter-markdown for
openSUSE:Factory checked in at 2026-03-17 19:03:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tree-sitter-markdown (Old)
and /work/SRC/openSUSE:Factory/.tree-sitter-markdown.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tree-sitter-markdown"
Tue Mar 17 19:03:31 2026 rev:8 rq:1339436 version:0.5.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/tree-sitter-markdown/tree-sitter-markdown.changes
2026-03-13 21:22:06.214457944 +0100
+++
/work/SRC/openSUSE:Factory/.tree-sitter-markdown.new.8177/tree-sitter-markdown.changes
2026-03-17 19:05:11.474396577 +0100
@@ -1,0 +2,10 @@
+Sat Mar 14 19:22:22 UTC 2026 - Matej Cepl <[email protected]>
+
+- Update to 0.5.3:
+ - fix: cmake --install
+ - fix: Correct typo to make "make install" work again
+ - feat: Implement other cursor wrapper methods
+ - fix: Allow ordered lists to start from any number
+ - chore: regenerate parser and bindings with 0.26.6
+
+-------------------------------------------------------------------
Old:
----
tree-sitter-markdown-0.5.2.tar.gz
New:
----
tree-sitter-markdown-0.5.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ tree-sitter-markdown.spec ++++++
--- /var/tmp/diff_new_pack.IkYb64/_old 2026-03-17 19:05:12.042420117 +0100
+++ /var/tmp/diff_new_pack.IkYb64/_new 2026-03-17 19:05:12.046420283 +0100
@@ -18,7 +18,7 @@
%define _name markdown
Name: tree-sitter-markdown
-Version: 0.5.2
+Version: 0.5.3
Release: 0
Summary: Markdown grammar for tree-sitter
License: MIT
++++++ tree-sitter-markdown-0.5.2.tar.gz -> tree-sitter-markdown-0.5.3.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/CMakeLists.txt
new/tree-sitter-markdown-0.5.3/CMakeLists.txt
--- old/tree-sitter-markdown-0.5.2/CMakeLists.txt 2026-01-11
11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/CMakeLists.txt 2026-02-26
19:04:19.000000000 +0100
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13)
project(tree-sitter-markdown
- VERSION "0.5.2"
+ VERSION "0.5.3"
DESCRIPTION "Markdown grammar for tree-sitter"
HOMEPAGE_URL
"https://github.com/tree-sitter-grammars/tree-sitter-markdown"
LANGUAGES C)
@@ -52,7 +52,7 @@
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree-sitter-${name}.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-${name}.pc" @ONLY)
- install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree-sitter-${name}.h"
+ install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree-sitter/tree-sitter-${name}.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/tree_sitter")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-${name}.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/Cargo.toml
new/tree-sitter-markdown-0.5.3/Cargo.toml
--- old/tree-sitter-markdown-0.5.2/Cargo.toml 2026-01-11 11:44:35.000000000
+0100
+++ new/tree-sitter-markdown-0.5.3/Cargo.toml 2026-02-26 19:04:19.000000000
+0100
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-md"
description = "Markdown grammar for tree-sitter"
-version = "0.5.2"
+version = "0.5.3"
authors = ["MDeiml"]
license = "MIT"
readme = "README.md"
@@ -25,7 +25,7 @@
]
[features]
-parser = ["tree-sitter"]
+parser = ["dep:tree-sitter"]
[lib]
path = "bindings/rust/lib.rs"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/bindings/rust/parser.rs
new/tree-sitter-markdown-0.5.3/bindings/rust/parser.rs
--- old/tree-sitter-markdown-0.5.2/bindings/rust/parser.rs 2026-01-11
11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/bindings/rust/parser.rs 2026-02-26
19:04:19.000000000 +0100
@@ -1,5 +1,5 @@
+use core::num::NonZeroU16;
use std::collections::HashMap;
-use std::num::NonZeroU16;
use tree_sitter::{
InputEdit, Language, Node, ParseOptions, Parser, Point, Range, Tree,
TreeCursor,
@@ -20,15 +20,18 @@
///
/// This exposes the same methods as [`TreeCursor`], but abstracts away the
/// double block / inline structure of [`MarkdownTree`].
-pub struct MarkdownCursor<'a> {
- markdown_tree: &'a MarkdownTree,
- block_cursor: TreeCursor<'a>,
- inline_cursor: Option<TreeCursor<'a>>,
+#[derive(Clone)]
+pub struct MarkdownCursor<'tree> {
+ markdown_tree: &'tree MarkdownTree,
+ block_cursor: TreeCursor<'tree>,
+ inline_cursor: Option<TreeCursor<'tree>>,
}
-impl<'a> MarkdownCursor<'a> {
+impl<'tree> MarkdownCursor<'tree> {
/// Get the cursor's current [`Node`].
- pub fn node(&self) -> Node<'a> {
+ #[doc(alias = "ts_tree_cursor_current_node")]
+ #[must_use]
+ pub fn node(&self) -> Node<'tree> {
match &self.inline_cursor {
Some(cursor) => cursor.node(),
None => self.block_cursor.node(),
@@ -39,6 +42,7 @@
///
/// This information is needed to handle "tree-sitter internal" data like
/// [`field_id`](Self::field_id) correctly.
+ #[must_use]
pub fn is_inline(&self) -> bool {
self.inline_cursor.is_some()
}
@@ -49,6 +53,8 @@
/// current node is an inline or block node.
///
/// See also [`field_name`](Self::field_name).
+ #[doc(alias = "ts_tree_cursor_current_field_id")]
+ #[must_use]
pub fn field_id(&self) -> Option<NonZeroU16> {
match &self.inline_cursor {
Some(cursor) => cursor.field_id(),
@@ -60,6 +66,8 @@
///
/// You will need to call [`is_inline`](Self::is_inline) to find out if the
/// current node is an inline or block node.
+ #[doc(alias = "ts_tree_cursor_current_field_name")]
+ #[must_use]
pub fn field_name(&self) -> Option<&'static str> {
match &self.inline_cursor {
Some(cursor) => cursor.field_name(),
@@ -67,6 +75,18 @@
}
}
+ /// Get the depth of the cursor's current node.
+ #[doc(alias = "ts_tree_cursor_current_depth")]
+ #[must_use]
+ pub fn depth(&self) -> u32 {
+ self.block_cursor.depth()
+ + self
+ .inline_cursor
+ .as_ref()
+ .map(TreeCursor::depth)
+ .unwrap_or(0)
+ }
+
fn move_to_inline_tree(&mut self) -> bool {
let node = self.block_cursor.node();
match node.kind() {
@@ -89,8 +109,10 @@
///
/// This returns `true` if the cursor successfully moved, and returns
`false` if there were no
/// children.
- /// If the cursor is currently at a node in the block tree and it has an
associated inline tree, it
- /// will descend into the inline tree.
+ ///
+ /// If the cursor is currently at a node in the block tree and it has an
associated inline tree,
+ /// it will descend into the inline tree.
+ #[doc(alias = "ts_tree_cursor_goto_first_child")]
pub fn goto_first_child(&mut self) -> bool {
match &mut self.inline_cursor {
Some(cursor) => cursor.goto_first_child(),
@@ -109,12 +131,41 @@
}
}
+ /// Move this cursor to the last child of its current node.
+ ///
+ /// This returns `true` if the cursor successfully moved, and returns
+ /// `false` if there were no children.
+ ///
+ /// Note that this function may be slower than
+ /// [`goto_first_child`](MarkdownCursor::goto_first_child) because it
needs to
+ /// iterate through all the children to compute the child's position.
+ #[doc(alias = "ts_tree_cursor_goto_last_child")]
+ pub fn goto_last_child(&mut self) -> bool {
+ match &mut self.inline_cursor {
+ Some(cursor) => cursor.goto_last_child(),
+ None => {
+ if self.move_to_inline_tree() {
+ if !self.inline_cursor.as_mut().unwrap().goto_last_child()
{
+ self.move_to_block_tree();
+ false
+ } else {
+ true
+ }
+ } else {
+ self.block_cursor.goto_last_child()
+ }
+ }
+ }
+ }
+
/// Move this cursor to the parent of its current node.
///
- /// This returns true if the cursor successfully moved, and returns false
if there was no
+ /// This returns `true` if the cursor successfully moved, and returns
`false` if there was no
/// parent node (the cursor was already on the root node).
- /// If the cursor moves to the root node of an inline tree, the it ascents
to the associated
+ ///
+ /// If the cursor moves to the root node of an inline tree, then it
ascents to the associated
/// node in the block tree.
+ #[doc(alias = "ts_tree_cursor_goto_parent")]
pub fn goto_parent(&mut self) -> bool {
match &mut self.inline_cursor {
Some(inline_cursor) => {
@@ -130,8 +181,9 @@
/// Move this cursor to the next sibling of its current node.
///
- /// This returns true if the cursor successfully moved, and returns false
if there was no next
- /// sibling node.
+ /// This returns `true` if the cursor successfully moved, and returns
`false` if there was no
+ /// next sibling node.
+ #[doc(alias = "ts_tree_cursor_goto_next_sibling")]
pub fn goto_next_sibling(&mut self) -> bool {
match &mut self.inline_cursor {
Some(inline_cursor) => inline_cursor.goto_next_sibling(),
@@ -139,11 +191,29 @@
}
}
+ /// Move this cursor to the previous sibling of its current node.
+ ///
+ /// This returns `true` if the cursor successfully moved, and returns
`false` if there was no
+ /// previous sibling node.
+ ///
+ /// Note, that this function may be slower than
+ /// [`goto_next_sibling`](MarkdownCursor::goto_next_sibling) due to how
node positions are
+ /// stored. In the worst case, this will need to iterate through all the
children up to the
+ /// previous sibling node to recalculate its position.
+ #[doc(alias = "ts_tree_cursor_goto_previous_sibling")]
+ pub fn goto_previous_sibling(&mut self) -> bool {
+ match &mut self.inline_cursor {
+ Some(inline_cursor) => inline_cursor.goto_previous_sibling(),
+ None => self.block_cursor.goto_previous_sibling(),
+ }
+ }
+
/// Move this cursor to the first child of its current node that extends
beyond the given byte offset.
///
/// This returns the index of the child node if one was found, and returns
None if no such child was found.
/// If the cursor is currently at a node in the block tree and it has an
associated inline tree, it
/// will descend into the inline tree.
+ #[doc(alias = "ts_tree_cursor_goto_first_child_for_byte")]
pub fn goto_first_child_for_byte(&mut self, index: usize) -> Option<usize>
{
match &mut self.inline_cursor {
Some(cursor) => cursor.goto_first_child_for_byte(index),
@@ -165,6 +235,7 @@
/// This returns the index of the child node if one was found, and returns
None if no such child was found.
/// If the cursor is currently at a node in the block tree and it has an
associated inline tree, it
/// will descend into the inline tree.
+ #[doc(alias = "ts_tree_cursor_goto_first_child_for_point")]
pub fn goto_first_child_for_point(&mut self, index: Point) ->
Option<usize> {
match &mut self.inline_cursor {
Some(cursor) => cursor.goto_first_child_for_point(index),
@@ -404,7 +475,11 @@
#[test]
fn inline_ranges() {
- let code = "# title\n\nInline [content].\n";
+ let code = "\
+ # title\n\
+ \n\
+ Inline [content].\n\
+ ";
let mut parser = MarkdownParser::default();
let mut tree = parser.parse(code.as_bytes(), None).unwrap();
@@ -426,7 +501,11 @@
"shortcut_link"
);
- let code = "# Title\n\nInline [content].\n";
+ let code = "\
+ # Title\n\
+ \n\
+ Inline [content].\n\
+ ";
tree.edit(&InputEdit {
start_byte: 2,
old_end_byte: 3,
@@ -458,31 +537,95 @@
#[test]
fn markdown_cursor() {
- let code = "# title\n\nInline [content].\n";
+ let code = "\
+ # title\n\
+ \n\
+ Inline [content].\n\
+ ";
let mut parser = MarkdownParser::default();
let tree = parser.parse(code.as_bytes(), None).unwrap();
let mut cursor = tree.walk();
+
assert_eq!(cursor.node().kind(), "document");
+ assert_eq!(cursor.depth(), 0);
+
assert!(cursor.goto_first_child());
assert_eq!(cursor.node().kind(), "section");
+ assert_eq!(cursor.depth(), 1);
+
assert!(cursor.goto_first_child());
assert_eq!(cursor.node().kind(), "atx_heading");
+ assert_eq!(cursor.depth(), 2);
+
assert!(cursor.goto_next_sibling());
assert_eq!(cursor.node().kind(), "paragraph");
+ assert_eq!(cursor.depth(), 2);
+
assert!(cursor.goto_first_child());
assert_eq!(cursor.node().kind(), "inline");
+ assert_eq!(cursor.depth(), 3);
+
assert!(cursor.goto_first_child());
assert_eq!(cursor.node().kind(), "shortcut_link");
+ assert_eq!(cursor.depth(), 4);
+
+ assert!(cursor.goto_next_sibling());
+ assert_eq!(cursor.node().kind(), ".");
+ assert_eq!(cursor.depth(), 4);
+
assert!(cursor.goto_parent());
+ assert_eq!(cursor.depth(), 3);
+
assert!(cursor.goto_parent());
+ assert_eq!(cursor.depth(), 2);
+
assert!(cursor.goto_parent());
+ assert_eq!(cursor.depth(), 1);
+
assert!(cursor.goto_parent());
assert_eq!(cursor.node().kind(), "document");
+ assert_eq!(cursor.depth(), 0);
+
+ assert!(cursor.goto_last_child());
+ assert_eq!(cursor.node().kind(), "section");
+ assert_eq!(cursor.depth(), 1);
+
+ assert!(cursor.goto_last_child());
+ assert_eq!(cursor.node().kind(), "paragraph");
+ assert_eq!(cursor.depth(), 2);
+
+ assert!(cursor.goto_previous_sibling());
+ assert_eq!(cursor.node().kind(), "atx_heading");
+ assert_eq!(cursor.depth(), 2);
+
+ assert!(cursor.goto_next_sibling());
+
+ assert!(cursor.goto_last_child());
+ assert_eq!(cursor.node().kind(), "inline");
+ assert_eq!(cursor.depth(), 3);
+
+ assert!(cursor.goto_last_child());
+ assert_eq!(cursor.node().kind(), ".");
+ assert_eq!(cursor.depth(), 4);
+
+ assert!(cursor.goto_previous_sibling());
+ assert_eq!(cursor.node().kind(), "shortcut_link");
+ assert_eq!(cursor.depth(), 4);
+
+ let mut cursor2 = cursor.clone();
+
+ assert!(cursor2.goto_parent());
+ assert_eq!(cursor2.depth(), 3);
+ assert_eq!(cursor.depth(), 4);
}
#[test]
fn table() {
- let code = "| foo |\n| --- |\n| *bar*|\n";
+ let code = "\
+ | foo |\n\
+ | --- |\n\
+ | *bar*|\n\
+ ";
let mut parser = MarkdownParser::default();
let tree = parser.parse(code.as_bytes(), None).unwrap();
dbg!(&tree.inline_trees());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/common/common.mak
new/tree-sitter-markdown-0.5.3/common/common.mak
--- old/tree-sitter-markdown-0.5.2/common/common.mak 2026-01-11
11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/common/common.mak 2026-02-26
19:04:19.000000000 +0100
@@ -1,5 +1,5 @@
HOMEPAGE_URL := https://github.com/tree-sitter-grammars/tree-sitter-markdown
-VERSION := 0.5.2
+VERSION := 0.5.3
# repository
SRC_DIR := src
@@ -79,7 +79,7 @@
install: all
install -d '$(DESTDIR)$(DATADIR)'/tree-sitter/queries/$(LANGUAGE_NAME)
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)'
'$(DESTDIR)$(LIBDIR)'
- install -m644 bindings/c/tree_sitter/$(LANGUAGE_NAME).h
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h
+ install -m644 bindings/c/tree-sitter/$(LANGUAGE_NAME).h
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h
install -m644 $(LANGUAGE_NAME).pc
'$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc
install -m644 lib$(LANGUAGE_NAME).a
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a
install -m755 lib$(LANGUAGE_NAME).$(SOEXT)
'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/package-lock.json
new/tree-sitter-markdown-0.5.3/package-lock.json
--- old/tree-sitter-markdown-0.5.2/package-lock.json 2026-01-11
11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/package-lock.json 2026-02-26
19:04:19.000000000 +0100
@@ -1,12 +1,12 @@
{
"name": "@tree-sitter-grammars/tree-sitter-markdown",
- "version": "0.5.2",
+ "version": "0.5.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@tree-sitter-grammars/tree-sitter-markdown",
- "version": "0.5.2",
+ "version": "0.5.3",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@@ -44,13 +44,15 @@
"type": "consulting",
"url": "https://feross.org/support"
}
- ]
+ ],
+ "license": "MIT"
},
"node_modules/bl": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
"integrity":
"sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"buffer": "^5.5.0",
"inherits": "^2.0.4",
@@ -76,6 +78,7 @@
"url": "https://feross.org/support"
}
],
+ "license": "MIT",
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
@@ -85,13 +88,15 @@
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
"integrity":
"sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
- "dev": true
+ "dev": true,
+ "license": "ISC"
},
"node_modules/end-of-stream": {
- "version": "1.4.4",
- "resolved":
"https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
- "integrity":
"sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "version": "1.4.5",
+ "resolved":
"https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
+ "integrity":
"sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"once": "^1.4.0"
}
@@ -100,7 +105,8 @@
"version": "1.0.0",
"resolved":
"https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity":
"sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/ieee754": {
"version": "1.2.1",
@@ -120,31 +126,22 @@
"type": "consulting",
"url": "https://feross.org/support"
}
- ]
+ ],
+ "license": "BSD-3-Clause"
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity":
"sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
- "dev": true
- },
- "node_modules/lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity":
"sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- }
+ "license": "ISC"
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity":
"sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
+ "license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -153,13 +150,15 @@
"version": "0.5.3",
"resolved":
"https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity":
"sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/node-abi": {
- "version": "3.56.0",
- "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.56.0.tgz",
- "integrity":
"sha512-fZjdhDOeRcaS+rcpve7XuwHBmktS1nS1gzgghwKUQQ8nTy2FdSDr6ZT8k6YhvlJeHmmQMYiT/IH9hfco5zeW2Q==",
+ "version": "3.87.0",
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.87.0.tgz",
+ "integrity":
"sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"semver": "^7.3.5"
},
@@ -168,18 +167,19 @@
}
},
"node_modules/node-addon-api": {
- "version": "8.2.1",
- "resolved":
"https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.2.1.tgz",
- "integrity":
"sha512-vmEOvxwiH8tlOcv4SyE8RH34rI5/nWVaigUeAUPawC6f0+HoDthwI0vkMu4tbtsZrXq6QXFfrkhjofzKEs5tpA==",
+ "version": "8.5.0",
+ "resolved":
"https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.5.0.tgz",
+ "integrity":
"sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==",
"license": "MIT",
"engines": {
"node": "^18 || ^20 || >= 21"
}
},
"node_modules/node-gyp-build": {
- "version": "4.8.2",
- "resolved":
"https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz",
- "integrity":
"sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==",
+ "version": "4.8.4",
+ "resolved":
"https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
+ "integrity":
"sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
+ "license": "MIT",
"bin": {
"node-gyp-build": "bin.js",
"node-gyp-build-optional": "optional.js",
@@ -191,6 +191,7 @@
"resolved":
"https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz",
"integrity":
"sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"path-key": "^3.0.0"
},
@@ -203,6 +204,7 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity":
"sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
+ "license": "ISC",
"dependencies": {
"wrappy": "1"
}
@@ -212,6 +214,7 @@
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity":
"sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=8"
}
@@ -221,6 +224,7 @@
"resolved":
"https://registry.npmjs.org/prebuildify/-/prebuildify-6.0.1.tgz",
"integrity":
"sha512-8Y2oOOateom/s8dNBsGIcnm6AxPmLH4/nanQzL5lQMU+sC0CMhzARZHizwr36pUPLdvBnOkCNQzxg4djuFSgIw==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"minimist": "^1.2.5",
"mkdirp-classic": "^0.5.3",
@@ -234,10 +238,11 @@
}
},
"node_modules/pump": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
- "integrity":
"sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
+ "integrity":
"sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
@@ -248,6 +253,7 @@
"resolved":
"https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
"integrity":
"sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
@@ -275,16 +281,15 @@
"type": "consulting",
"url": "https://feross.org/support"
}
- ]
+ ],
+ "license": "MIT"
},
"node_modules/semver": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
- "integrity":
"sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
+ "version": "7.7.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
+ "integrity":
"sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
"dev": true,
- "dependencies": {
- "lru-cache": "^6.0.0"
- },
+ "license": "ISC",
"bin": {
"semver": "bin/semver.js"
},
@@ -297,6 +302,7 @@
"resolved":
"https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity":
"sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"safe-buffer": "~5.2.0"
}
@@ -319,6 +325,7 @@
"resolved":
"https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
"integrity":
"sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"bl": "^4.0.3",
"end-of-stream": "^1.4.1",
@@ -335,6 +342,7 @@
"resolved":
"https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.21.1.tgz",
"integrity":
"sha512-7dxoA6kYvtgWw80265MyqJlkRl4yawIjO7S5MigytjELkX43fV2WsAXzsNfO7sBpPPCF5Gp0+XzHk0DwLCq3xQ==",
"hasInstallScript": true,
+ "license": "MIT",
"peer": true,
"dependencies": {
"node-addon-api": "^8.0.0",
@@ -342,9 +350,9 @@
}
},
"node_modules/tree-sitter-cli": {
- "version": "0.24.3",
- "resolved":
"https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.24.3.tgz",
- "integrity":
"sha512-5vS0SiJf31tMTn9CYLsu5l18qXaw5MLFka3cuGxOB5f4TtgoUSK1Sog6rKmqBc7PvFJq37YcQBjj9giNy2cJPw==",
+ "version": "0.24.7",
+ "resolved":
"https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.24.7.tgz",
+ "integrity":
"sha512-o4gnE82pVmMMhJbWwD6+I9yr4lXii5Ci5qEQ2pFpUbVy1YiD8cizTJaqdcznA0qEbo7l2OneI1GocChPrI4YGQ==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
@@ -359,19 +367,15 @@
"version": "1.0.2",
"resolved":
"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity":
"sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity":
"sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
- "dev": true
- },
- "node_modules/yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity":
"sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
- "dev": true
+ "dev": true,
+ "license": "ISC"
}
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/package.json
new/tree-sitter-markdown-0.5.3/package.json
--- old/tree-sitter-markdown-0.5.2/package.json 2026-01-11 11:44:35.000000000
+0100
+++ new/tree-sitter-markdown-0.5.3/package.json 2026-02-26 19:04:19.000000000
+0100
@@ -1,6 +1,6 @@
{
"name": "@tree-sitter-grammars/tree-sitter-markdown",
- "version": "0.5.2",
+ "version": "0.5.3",
"description": "Markdown grammar for tree-sitter",
"repository": "github:tree-sitter-grammars/tree-sitter-markdown",
"license": "MIT",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/pyproject.toml
new/tree-sitter-markdown-0.5.3/pyproject.toml
--- old/tree-sitter-markdown-0.5.2/pyproject.toml 2026-01-11
11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/pyproject.toml 2026-02-26
19:04:19.000000000 +0100
@@ -5,7 +5,7 @@
[project]
name = "tree-sitter-markdown"
description = "Markdown grammar for tree-sitter"
-version = "0.5.2"
+version = "0.5.3"
keywords = ["incremental", "parsing", "tree-sitter", "markdown"]
classifiers = [
"Intended Audience :: Developers",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/setup.py
new/tree-sitter-markdown-0.5.3/setup.py
--- old/tree-sitter-markdown-0.5.2/setup.py 2026-01-11 11:44:35.000000000
+0100
+++ new/tree-sitter-markdown-0.5.3/setup.py 2026-02-26 19:04:19.000000000
+0100
@@ -32,7 +32,7 @@
class BdistWheel(bdist_wheel):
def get_tag(self):
python, abi, platform = super().get_tag()
- if python.startswith("cp"):
+ if python.startswith("cp") and not get_config_var("Py_GIL_DISABLED"):
python, abi = "cp310", "abi3"
return python, abi, platform
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.2/tree-sitter-markdown/src/parser.c
new/tree-sitter-markdown-0.5.3/tree-sitter-markdown/src/parser.c
--- old/tree-sitter-markdown-0.5.2/tree-sitter-markdown/src/parser.c
2026-01-11 11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/tree-sitter-markdown/src/parser.c
2026-02-26 19:04:19.000000000 +0100
@@ -59777,7 +59777,7 @@
.metadata = {
.major_version = 0,
.minor_version = 5,
- .patch_version = 2,
+ .patch_version = 3,
},
};
return &language;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.2/tree-sitter-markdown/src/scanner.c
new/tree-sitter-markdown-0.5.3/tree-sitter-markdown/src/scanner.c
--- old/tree-sitter-markdown-0.5.2/tree-sitter-markdown/src/scanner.c
2026-01-11 11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/tree-sitter-markdown/src/scanner.c
2026-02-26 19:04:19.000000000 +0100
@@ -735,7 +735,7 @@
valid_symbols[LIST_MARKER_PARENTHESIS_DONT_INTERRUPT] ||
valid_symbols[LIST_MARKER_DOT_DONT_INTERRUPT])) {
size_t digits = 1;
- bool dont_interrupt = lexer->lookahead != '1';
+ bool dont_interrupt = !isdigit(lexer->lookahead);
advance(s, lexer);
while (isdigit(lexer->lookahead)) {
dont_interrupt = true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.2/tree-sitter-markdown/src/tree_sitter/array.h
new/tree-sitter-markdown-0.5.3/tree-sitter-markdown/src/tree_sitter/array.h
--- old/tree-sitter-markdown-0.5.2/tree-sitter-markdown/src/tree_sitter/array.h
2026-01-11 11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/tree-sitter-markdown/src/tree_sitter/array.h
2026-02-26 19:04:19.000000000 +0100
@@ -52,67 +52,96 @@
/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is
/// less than the array's current capacity, this function has no effect.
-#define array_reserve(self, new_capacity) \
- _array__reserve((Array *)(self), array_elem_size(self), new_capacity)
+#define array_reserve(self, new_capacity) \
+ ((self)->contents = _array__reserve( \
+ (void *)(self)->contents, &(self)->capacity, \
+ array_elem_size(self), new_capacity) \
+ )
/// Free any memory allocated for this array. Note that this does not free any
/// memory allocated for the array's contents.
-#define array_delete(self) _array__delete((Array *)(self))
+#define array_delete(self) \
+ do { \
+ if ((self)->contents) ts_free((self)->contents); \
+ (self)->contents = NULL; \
+ (self)->size = 0; \
+ (self)->capacity = 0; \
+ } while (0)
/// Push a new `element` onto the end of the array.
-#define array_push(self, element) \
- (_array__grow((Array *)(self), 1, array_elem_size(self)), \
- (self)->contents[(self)->size++] = (element))
+#define array_push(self, element) \
+ do { \
+ (self)->contents = _array__grow( \
+ (void *)(self)->contents, (self)->size, &(self)->capacity, \
+ 1, array_elem_size(self) \
+ ); \
+ (self)->contents[(self)->size++] = (element); \
+ } while(0)
/// Increase the array's size by `count` elements.
/// New elements are zero-initialized.
-#define array_grow_by(self, count) \
- do { \
- if ((count) == 0) break; \
- _array__grow((Array *)(self), count, array_elem_size(self)); \
+#define array_grow_by(self, count)
\
+ do {
\
+ if ((count) == 0) break;
\
+ (self)->contents = _array__grow(
\
+ (self)->contents, (self)->size, &(self)->capacity,
\
+ count, array_elem_size(self)
\
+ );
\
memset((self)->contents + (self)->size, 0, (count) *
array_elem_size(self)); \
- (self)->size += (count); \
+ (self)->size += (count);
\
} while (0)
/// Append all elements from one array to the end of another.
-#define array_push_all(self, other) \
+#define array_push_all(self, other) \
array_extend((self), (other)->size, (other)->contents)
/// Append `count` elements to the end of the array, reading their values from
the
/// `contents` pointer.
-#define array_extend(self, count, contents) \
- _array__splice( \
- (Array *)(self), array_elem_size(self), (self)->size, \
- 0, count, contents \
+#define array_extend(self, count, other_contents) \
+ (self)->contents = _array__splice( \
+ (void*)(self)->contents, &(self)->size, &(self)->capacity, \
+ array_elem_size(self), (self)->size, 0, count, other_contents \
)
/// Remove `old_count` elements from the array starting at the given `index`.
At
/// the same index, insert `new_count` new elements, reading their values from
the
/// `new_contents` pointer.
-#define array_splice(self, _index, old_count, new_count, new_contents) \
- _array__splice( \
- (Array *)(self), array_elem_size(self), _index, \
- old_count, new_count, new_contents \
+#define array_splice(self, _index, old_count, new_count, new_contents) \
+ (self)->contents = _array__splice( \
+ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
+ array_elem_size(self), _index, old_count, new_count, new_contents \
)
/// Insert one `element` into the array at the given `index`.
-#define array_insert(self, _index, element) \
- _array__splice((Array *)(self), array_elem_size(self), _index, 0, 1,
&(element))
+#define array_insert(self, _index, element) \
+ (self)->contents = _array__splice( \
+ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
+ array_elem_size(self), _index, 0, 1, &(element) \
+ )
/// Remove one element from the array at the given `index`.
#define array_erase(self, _index) \
- _array__erase((Array *)(self), array_elem_size(self), _index)
+ _array__erase((void *)(self)->contents, &(self)->size,
array_elem_size(self), _index)
/// Pop the last element off the array, returning the element by value.
#define array_pop(self) ((self)->contents[--(self)->size])
/// Assign the contents of one array to another, reallocating if necessary.
-#define array_assign(self, other) \
- _array__assign((Array *)(self), (const Array *)(other),
array_elem_size(self))
+#define array_assign(self, other) \
+ (self)->contents = _array__assign( \
+ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
+ (const void *)(other)->contents, (other)->size, array_elem_size(self) \
+ )
/// Swap one array with another
-#define array_swap(self, other) \
- _array__swap((Array *)(self), (Array *)(other))
+#define array_swap(self, other) \
+ do { \
+ void *_array_swap_tmp = (void *)(self)->contents; \
+ (self)->contents = (other)->contents; \
+ (other)->contents = _array_swap_tmp; \
+ _array__swap(&(self)->size, &(self)->capacity, \
+ &(other)->size, &(other)->capacity); \
+ } while (0)
/// Get the size of the array contents
#define array_elem_size(self) (sizeof *(self)->contents)
@@ -157,82 +186,90 @@
// Private
-typedef Array(void) Array;
-
-/// This is not what you're looking for, see `array_delete`.
-static inline void _array__delete(Array *self) {
- if (self->contents) {
- ts_free(self->contents);
- self->contents = NULL;
- self->size = 0;
- self->capacity = 0;
- }
-}
+// Pointers to individual `Array` fields (rather than the entire `Array`
itself)
+// are passed to the various `_array__*` functions below to address strict
aliasing
+// violations that arises when the _entire_ `Array` struct is passed as
`Array(void)*`.
+//
+// The `Array` type itself was not altered as a solution in order to avoid
breakage
+// with existing consumers (in particular, parsers with external scanners).
/// This is not what you're looking for, see `array_erase`.
-static inline void _array__erase(Array *self, size_t element_size,
- uint32_t index) {
- assert(index < self->size);
- char *contents = (char *)self->contents;
+static inline void _array__erase(void* self_contents, uint32_t *size,
+ size_t element_size, uint32_t index) {
+ assert(index < *size);
+ char *contents = (char *)self_contents;
memmove(contents + index * element_size, contents + (index + 1) *
element_size,
- (self->size - index - 1) * element_size);
- self->size--;
+ (*size - index - 1) * element_size);
+ (*size)--;
}
/// This is not what you're looking for, see `array_reserve`.
-static inline void _array__reserve(Array *self, size_t element_size, uint32_t
new_capacity) {
- if (new_capacity > self->capacity) {
- if (self->contents) {
- self->contents = ts_realloc(self->contents, new_capacity * element_size);
+static inline void *_array__reserve(void *contents, uint32_t *capacity,
+ size_t element_size, uint32_t new_capacity) {
+ void *new_contents = contents;
+ if (new_capacity > *capacity) {
+ if (contents) {
+ new_contents = ts_realloc(contents, new_capacity * element_size);
} else {
- self->contents = ts_malloc(new_capacity * element_size);
+ new_contents = ts_malloc(new_capacity * element_size);
}
- self->capacity = new_capacity;
+ *capacity = new_capacity;
}
+ return new_contents;
}
/// This is not what you're looking for, see `array_assign`.
-static inline void _array__assign(Array *self, const Array *other, size_t
element_size) {
- _array__reserve(self, element_size, other->size);
- self->size = other->size;
- memcpy(self->contents, other->contents, self->size * element_size);
+static inline void *_array__assign(void* self_contents, uint32_t *self_size,
uint32_t *self_capacity,
+ const void *other_contents, uint32_t
other_size, size_t element_size) {
+ void *new_contents = _array__reserve(self_contents, self_capacity,
element_size, other_size);
+ *self_size = other_size;
+ memcpy(new_contents, other_contents, *self_size * element_size);
+ return new_contents;
}
/// This is not what you're looking for, see `array_swap`.
-static inline void _array__swap(Array *self, Array *other) {
- Array swap = *other;
- *other = *self;
- *self = swap;
+static inline void _array__swap(uint32_t *self_size, uint32_t *self_capacity,
+ uint32_t *other_size, uint32_t *other_capacity)
{
+ uint32_t tmp_size = *self_size;
+ uint32_t tmp_capacity = *self_capacity;
+ *self_size = *other_size;
+ *self_capacity = *other_capacity;
+ *other_size = tmp_size;
+ *other_capacity = tmp_capacity;
}
/// This is not what you're looking for, see `array_push` or `array_grow_by`.
-static inline void _array__grow(Array *self, uint32_t count, size_t
element_size) {
- uint32_t new_size = self->size + count;
- if (new_size > self->capacity) {
- uint32_t new_capacity = self->capacity * 2;
+static inline void *_array__grow(void *contents, uint32_t size, uint32_t
*capacity,
+ uint32_t count, size_t element_size) {
+ void *new_contents = contents;
+ uint32_t new_size = size + count;
+ if (new_size > *capacity) {
+ uint32_t new_capacity = *capacity * 2;
if (new_capacity < 8) new_capacity = 8;
if (new_capacity < new_size) new_capacity = new_size;
- _array__reserve(self, element_size, new_capacity);
+ new_contents = _array__reserve(contents, capacity, element_size,
new_capacity);
}
+ return new_contents;
}
/// This is not what you're looking for, see `array_splice`.
-static inline void _array__splice(Array *self, size_t element_size,
+static inline void *_array__splice(void *self_contents, uint32_t *size,
uint32_t *capacity,
+ size_t element_size,
uint32_t index, uint32_t old_count,
uint32_t new_count, const void *elements) {
- uint32_t new_size = self->size + new_count - old_count;
+ uint32_t new_size = *size + new_count - old_count;
uint32_t old_end = index + old_count;
uint32_t new_end = index + new_count;
- assert(old_end <= self->size);
+ assert(old_end <= *size);
- _array__reserve(self, element_size, new_size);
+ void *new_contents = _array__reserve(self_contents, capacity, element_size,
new_size);
- char *contents = (char *)self->contents;
- if (self->size > old_end) {
+ char *contents = (char *)new_contents;
+ if (*size > old_end) {
memmove(
contents + new_end * element_size,
contents + old_end * element_size,
- (self->size - old_end) * element_size
+ (*size - old_end) * element_size
);
}
if (new_count > 0) {
@@ -250,7 +287,9 @@
);
}
}
- self->size += new_count - old_count;
+ *size += new_count - old_count;
+
+ return new_contents;
}
/// A binary search routine, based on Rust's `std::slice::binary_search_by`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.2/tree-sitter-markdown/test/corpus/issues.txt
new/tree-sitter-markdown-0.5.3/tree-sitter-markdown/test/corpus/issues.txt
--- old/tree-sitter-markdown-0.5.2/tree-sitter-markdown/test/corpus/issues.txt
2026-01-11 11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/tree-sitter-markdown/test/corpus/issues.txt
2026-02-26 19:04:19.000000000 +0100
@@ -114,3 +114,58 @@
(fenced_code_block_delimiter))
(paragraph
(inline))))
+
+================================================================================
+#226 (PR) - Allow ordered lists to start from any number
+================================================================================
+
+* List item
+ 0) Zero
+ 1) One
+ 2) Two
+
+* Backwards list
+ 9) Nine
+ 8) Eight
+
+--------------------------------------------------------------------------------
+
+(document
+ (section
+ (list
+ (list_item
+ (list_marker_star)
+ (paragraph
+ (inline)
+ (block_continuation))
+ (list
+ (list_item
+ (list_marker_parenthesis)
+ (paragraph
+ (inline)
+ (block_continuation)))
+ (list_item
+ (list_marker_parenthesis)
+ (paragraph
+ (inline)
+ (block_continuation)))
+ (list_item
+ (list_marker_parenthesis)
+ (paragraph
+ (inline)
+ (block_continuation)))))
+ (list_item
+ (list_marker_star)
+ (paragraph
+ (inline)
+ (block_continuation))
+ (list
+ (list_item
+ (list_marker_parenthesis)
+ (paragraph
+ (inline)
+ (block_continuation)))
+ (list_item
+ (list_marker_parenthesis)
+ (paragraph
+ (inline))))))))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/src/parser.c
new/tree-sitter-markdown-0.5.3/tree-sitter-markdown-inline/src/parser.c
--- old/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/src/parser.c
2026-01-11 11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/tree-sitter-markdown-inline/src/parser.c
2026-02-26 19:04:19.000000000 +0100
@@ -75699,7 +75699,7 @@
.metadata = {
.major_version = 0,
.minor_version = 5,
- .patch_version = 2,
+ .patch_version = 3,
},
};
return &language;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/src/tree_sitter/array.h
new/tree-sitter-markdown-0.5.3/tree-sitter-markdown-inline/src/tree_sitter/array.h
---
old/tree-sitter-markdown-0.5.2/tree-sitter-markdown-inline/src/tree_sitter/array.h
2026-01-11 11:44:35.000000000 +0100
+++
new/tree-sitter-markdown-0.5.3/tree-sitter-markdown-inline/src/tree_sitter/array.h
2026-02-26 19:04:19.000000000 +0100
@@ -52,67 +52,96 @@
/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is
/// less than the array's current capacity, this function has no effect.
-#define array_reserve(self, new_capacity) \
- _array__reserve((Array *)(self), array_elem_size(self), new_capacity)
+#define array_reserve(self, new_capacity) \
+ ((self)->contents = _array__reserve( \
+ (void *)(self)->contents, &(self)->capacity, \
+ array_elem_size(self), new_capacity) \
+ )
/// Free any memory allocated for this array. Note that this does not free any
/// memory allocated for the array's contents.
-#define array_delete(self) _array__delete((Array *)(self))
+#define array_delete(self) \
+ do { \
+ if ((self)->contents) ts_free((self)->contents); \
+ (self)->contents = NULL; \
+ (self)->size = 0; \
+ (self)->capacity = 0; \
+ } while (0)
/// Push a new `element` onto the end of the array.
-#define array_push(self, element) \
- (_array__grow((Array *)(self), 1, array_elem_size(self)), \
- (self)->contents[(self)->size++] = (element))
+#define array_push(self, element) \
+ do { \
+ (self)->contents = _array__grow( \
+ (void *)(self)->contents, (self)->size, &(self)->capacity, \
+ 1, array_elem_size(self) \
+ ); \
+ (self)->contents[(self)->size++] = (element); \
+ } while(0)
/// Increase the array's size by `count` elements.
/// New elements are zero-initialized.
-#define array_grow_by(self, count) \
- do { \
- if ((count) == 0) break; \
- _array__grow((Array *)(self), count, array_elem_size(self)); \
+#define array_grow_by(self, count)
\
+ do {
\
+ if ((count) == 0) break;
\
+ (self)->contents = _array__grow(
\
+ (self)->contents, (self)->size, &(self)->capacity,
\
+ count, array_elem_size(self)
\
+ );
\
memset((self)->contents + (self)->size, 0, (count) *
array_elem_size(self)); \
- (self)->size += (count); \
+ (self)->size += (count);
\
} while (0)
/// Append all elements from one array to the end of another.
-#define array_push_all(self, other) \
+#define array_push_all(self, other) \
array_extend((self), (other)->size, (other)->contents)
/// Append `count` elements to the end of the array, reading their values from
the
/// `contents` pointer.
-#define array_extend(self, count, contents) \
- _array__splice( \
- (Array *)(self), array_elem_size(self), (self)->size, \
- 0, count, contents \
+#define array_extend(self, count, other_contents) \
+ (self)->contents = _array__splice( \
+ (void*)(self)->contents, &(self)->size, &(self)->capacity, \
+ array_elem_size(self), (self)->size, 0, count, other_contents \
)
/// Remove `old_count` elements from the array starting at the given `index`.
At
/// the same index, insert `new_count` new elements, reading their values from
the
/// `new_contents` pointer.
-#define array_splice(self, _index, old_count, new_count, new_contents) \
- _array__splice( \
- (Array *)(self), array_elem_size(self), _index, \
- old_count, new_count, new_contents \
+#define array_splice(self, _index, old_count, new_count, new_contents) \
+ (self)->contents = _array__splice( \
+ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
+ array_elem_size(self), _index, old_count, new_count, new_contents \
)
/// Insert one `element` into the array at the given `index`.
-#define array_insert(self, _index, element) \
- _array__splice((Array *)(self), array_elem_size(self), _index, 0, 1,
&(element))
+#define array_insert(self, _index, element) \
+ (self)->contents = _array__splice( \
+ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
+ array_elem_size(self), _index, 0, 1, &(element) \
+ )
/// Remove one element from the array at the given `index`.
#define array_erase(self, _index) \
- _array__erase((Array *)(self), array_elem_size(self), _index)
+ _array__erase((void *)(self)->contents, &(self)->size,
array_elem_size(self), _index)
/// Pop the last element off the array, returning the element by value.
#define array_pop(self) ((self)->contents[--(self)->size])
/// Assign the contents of one array to another, reallocating if necessary.
-#define array_assign(self, other) \
- _array__assign((Array *)(self), (const Array *)(other),
array_elem_size(self))
+#define array_assign(self, other) \
+ (self)->contents = _array__assign( \
+ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
+ (const void *)(other)->contents, (other)->size, array_elem_size(self) \
+ )
/// Swap one array with another
-#define array_swap(self, other) \
- _array__swap((Array *)(self), (Array *)(other))
+#define array_swap(self, other) \
+ do { \
+ void *_array_swap_tmp = (void *)(self)->contents; \
+ (self)->contents = (other)->contents; \
+ (other)->contents = _array_swap_tmp; \
+ _array__swap(&(self)->size, &(self)->capacity, \
+ &(other)->size, &(other)->capacity); \
+ } while (0)
/// Get the size of the array contents
#define array_elem_size(self) (sizeof *(self)->contents)
@@ -157,82 +186,90 @@
// Private
-typedef Array(void) Array;
-
-/// This is not what you're looking for, see `array_delete`.
-static inline void _array__delete(Array *self) {
- if (self->contents) {
- ts_free(self->contents);
- self->contents = NULL;
- self->size = 0;
- self->capacity = 0;
- }
-}
+// Pointers to individual `Array` fields (rather than the entire `Array`
itself)
+// are passed to the various `_array__*` functions below to address strict
aliasing
+// violations that arises when the _entire_ `Array` struct is passed as
`Array(void)*`.
+//
+// The `Array` type itself was not altered as a solution in order to avoid
breakage
+// with existing consumers (in particular, parsers with external scanners).
/// This is not what you're looking for, see `array_erase`.
-static inline void _array__erase(Array *self, size_t element_size,
- uint32_t index) {
- assert(index < self->size);
- char *contents = (char *)self->contents;
+static inline void _array__erase(void* self_contents, uint32_t *size,
+ size_t element_size, uint32_t index) {
+ assert(index < *size);
+ char *contents = (char *)self_contents;
memmove(contents + index * element_size, contents + (index + 1) *
element_size,
- (self->size - index - 1) * element_size);
- self->size--;
+ (*size - index - 1) * element_size);
+ (*size)--;
}
/// This is not what you're looking for, see `array_reserve`.
-static inline void _array__reserve(Array *self, size_t element_size, uint32_t
new_capacity) {
- if (new_capacity > self->capacity) {
- if (self->contents) {
- self->contents = ts_realloc(self->contents, new_capacity * element_size);
+static inline void *_array__reserve(void *contents, uint32_t *capacity,
+ size_t element_size, uint32_t new_capacity) {
+ void *new_contents = contents;
+ if (new_capacity > *capacity) {
+ if (contents) {
+ new_contents = ts_realloc(contents, new_capacity * element_size);
} else {
- self->contents = ts_malloc(new_capacity * element_size);
+ new_contents = ts_malloc(new_capacity * element_size);
}
- self->capacity = new_capacity;
+ *capacity = new_capacity;
}
+ return new_contents;
}
/// This is not what you're looking for, see `array_assign`.
-static inline void _array__assign(Array *self, const Array *other, size_t
element_size) {
- _array__reserve(self, element_size, other->size);
- self->size = other->size;
- memcpy(self->contents, other->contents, self->size * element_size);
+static inline void *_array__assign(void* self_contents, uint32_t *self_size,
uint32_t *self_capacity,
+ const void *other_contents, uint32_t
other_size, size_t element_size) {
+ void *new_contents = _array__reserve(self_contents, self_capacity,
element_size, other_size);
+ *self_size = other_size;
+ memcpy(new_contents, other_contents, *self_size * element_size);
+ return new_contents;
}
/// This is not what you're looking for, see `array_swap`.
-static inline void _array__swap(Array *self, Array *other) {
- Array swap = *other;
- *other = *self;
- *self = swap;
+static inline void _array__swap(uint32_t *self_size, uint32_t *self_capacity,
+ uint32_t *other_size, uint32_t *other_capacity)
{
+ uint32_t tmp_size = *self_size;
+ uint32_t tmp_capacity = *self_capacity;
+ *self_size = *other_size;
+ *self_capacity = *other_capacity;
+ *other_size = tmp_size;
+ *other_capacity = tmp_capacity;
}
/// This is not what you're looking for, see `array_push` or `array_grow_by`.
-static inline void _array__grow(Array *self, uint32_t count, size_t
element_size) {
- uint32_t new_size = self->size + count;
- if (new_size > self->capacity) {
- uint32_t new_capacity = self->capacity * 2;
+static inline void *_array__grow(void *contents, uint32_t size, uint32_t
*capacity,
+ uint32_t count, size_t element_size) {
+ void *new_contents = contents;
+ uint32_t new_size = size + count;
+ if (new_size > *capacity) {
+ uint32_t new_capacity = *capacity * 2;
if (new_capacity < 8) new_capacity = 8;
if (new_capacity < new_size) new_capacity = new_size;
- _array__reserve(self, element_size, new_capacity);
+ new_contents = _array__reserve(contents, capacity, element_size,
new_capacity);
}
+ return new_contents;
}
/// This is not what you're looking for, see `array_splice`.
-static inline void _array__splice(Array *self, size_t element_size,
+static inline void *_array__splice(void *self_contents, uint32_t *size,
uint32_t *capacity,
+ size_t element_size,
uint32_t index, uint32_t old_count,
uint32_t new_count, const void *elements) {
- uint32_t new_size = self->size + new_count - old_count;
+ uint32_t new_size = *size + new_count - old_count;
uint32_t old_end = index + old_count;
uint32_t new_end = index + new_count;
- assert(old_end <= self->size);
+ assert(old_end <= *size);
- _array__reserve(self, element_size, new_size);
+ void *new_contents = _array__reserve(self_contents, capacity, element_size,
new_size);
- char *contents = (char *)self->contents;
- if (self->size > old_end) {
+ char *contents = (char *)new_contents;
+ if (*size > old_end) {
memmove(
contents + new_end * element_size,
contents + old_end * element_size,
- (self->size - old_end) * element_size
+ (*size - old_end) * element_size
);
}
if (new_count > 0) {
@@ -250,7 +287,9 @@
);
}
}
- self->size += new_count - old_count;
+ *size += new_count - old_count;
+
+ return new_contents;
}
/// A binary search routine, based on Rust's `std::slice::binary_search_by`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tree-sitter-markdown-0.5.2/tree-sitter.json
new/tree-sitter-markdown-0.5.3/tree-sitter.json
--- old/tree-sitter-markdown-0.5.2/tree-sitter.json 2026-01-11
11:44:35.000000000 +0100
+++ new/tree-sitter-markdown-0.5.3/tree-sitter.json 2026-02-26
19:04:19.000000000 +0100
@@ -1,52 +1,54 @@
{
- "metadata": {
- "version": "0.5.2",
- "license": "MIT",
- "authors": [
- {
- "name": "MDeiml"
- }
- ],
- "description": "Markdown grammar for tree-sitter",
- "links": {
- "repository":
"https://github.com/tree-sitter-grammars/tree-sitter-markdown"
- }
- },
+ "$schema":
"https://tree-sitter.github.io/tree-sitter/assets/schemas/config.schema.json",
"grammars": [
{
"name": "markdown",
"scope": "text.markdown",
"path": "tree-sitter-markdown",
- "injection-regex": "^(markdown|md)$",
+ "external-files": [
+ "common/common.js"
+ ],
"file-types": [
"md"
],
"highlights": "tree-sitter-markdown/queries/highlights.scm",
"injections": "tree-sitter-markdown/queries/injections.scm",
- "external-files": [
- "common/common.js"
- ]
+ "injection-regex": "^(markdown|md)$"
},
{
"name": "markdown_inline",
"camelcase": "MarkdownInline",
"scope": "text.markdown_inline",
"path": "tree-sitter-markdown-inline",
- "highlights": "tree-sitter-markdown-inline/queries/highlights.scm",
- "injections": "tree-sitter-markdown-inline/queries/injections.scm",
"external-files": [
"common/common.js"
- ]
+ ],
+ "file-types": null,
+ "highlights": "tree-sitter-markdown-inline/queries/highlights.scm",
+ "injections": "tree-sitter-markdown-inline/queries/injections.scm"
}
],
+ "metadata": {
+ "version": "0.5.3",
+ "license": "MIT",
+ "description": "Markdown grammar for tree-sitter",
+ "authors": [
+ {
+ "name": "MDeiml"
+ }
+ ],
+ "links": {
+ "repository":
"https://github.com/tree-sitter-grammars/tree-sitter-markdown"
+ }
+ },
"bindings": {
- "rust": true,
- "node": true,
"c": true,
- "python": true,
- "swift": true,
"go": false,
"java": false,
+ "node": true,
+ "python": true,
+ "rust": true,
+ "swift": true,
"zig": false
}
}