docs: improve comment explaining empty node kind workaround in compatibility test

This commit is contained in:
bglgwyng 2025-11-20 23:16:34 +09:00
parent c19cce111f
commit 3bfbc00bc0

View file

@ -1278,7 +1278,9 @@ fn test_parser_and_node_types_compatibility(grammar_name: &str) {
let kind = language.node_kind_for_id(i).unwrap();
let named = language.node_kind_is_named(i);
// workaround maybe?
// TODO: find a better way
// In Go grammar, there is a node kind with an empty string.
// In node-types.json, it is "\u0000" but in parser.c, it is "\0" and not distinguishable from "".
let kind = if kind.is_empty() {
"\0".to_string()
} else {