fix(generate): mark TSCharacterRange as static (#4255)

Problem: Linking different parsers into one executable fails due to duplicate symbols.

Solution: Mark `TSCharacterRange` as `static` when generating parsers.

fixes #4209

(cherry picked from commit 8138dba800)
This commit is contained in:
polazarus 2025-03-04 15:26:13 +01:00 committed by Christian Clason
parent 6f2dbaab5f
commit b1a7074010

View file

@ -1111,7 +1111,11 @@ impl Generator {
return;
}
add_line!(self, "const TSCharacterRange {}[] = {{", info.constant_name);
add_line!(
self,
"static const TSCharacterRange {}[] = {{",
info.constant_name
);
indent!(self);
for (ix, range) in characters.ranges().enumerate() {