From f466b8325ed41ce4f910dba060eba105c8d23994 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 25 Aug 2024 08:48:23 +0300 Subject: [PATCH] ; * src/treesit.c (Ftreesit_parse_string): Fix comment and punctuation. (cherry picked from commit 8a94cee3b58a59eac6ca24c001769f0fe12bf020) --- src/treesit.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/treesit.c b/src/treesit.c index 218cb7407a8..5aedca44489 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1863,16 +1863,16 @@ positions. PARSER is the parser issuing the notification. */) return Qnil; } -// Why don't we use ts_parse_string? I tried, but it requires too much -// change throughout treesit.c: we either return a root node that has no -// associated parser, or one that has a parser but the parser doesn't -// have associated buffer. Both route requires us to add checks and -// branches everytime we use the parser of a node or the buffer of a -// parser. I tried route 1, and found that on top of needing to add a -// bunch of branches to handle the no-parser case, many functions -// requires a parser alongside the node (getting the tree, or language -// symbol, etc), and I would need to rewrite those as well. Overall -// it's just not worth it--this is just a convenience function. --yuan +/* Why don't we use ts_parse_string? I tried, but it requires too much + change throughout treesit.c: we either return a root node that has no + associated parser, or one that has a parser but the parser doesn't + have associated buffer. Both routes require us to add checks and + branches everywhere we use the parser of a node or the buffer of a + parser. I tried route 1, and found that on top of the need to add a + bunch of branches to handle the no-parser case, many functions + require a parser alongside the node (getting the tree, or language + symbol, etc), and I would need to rewrite those as well. Overall, + it's just not worth it--this is just a convenience function. --yuan */ DEFUN ("treesit-parse-string", Ftreesit_parse_string, Streesit_parse_string, 2, 2, 0, -- 2.39.2