Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 52887cc

Browse files
author
Hendrik van Antwerpen
committed
Replace meta comments with whitespace for file formats that do not have a comment format, such as JSON
1 parent 2708e89 commit 52887cc

File tree

1 file changed

+6
-2
lines changed
  • tree-sitter-stack-graphs/src

1 file changed

+6
-2
lines changed

tree-sitter-stack-graphs/src/test.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ impl Test {
183183
current_path = m.get(1).unwrap().as_str().into();
184184
current_source = prev_source.clone();
185185
current_globals = HashMap::new();
186+
187+
Self::push_whitespace_for(&current_line, &mut current_source);
186188
} else if let Some(m) = GLOBAL_REGEX.captures_iter(current_line.content).next() {
187189
have_globals = true;
188190
let global_name = m.get(1).unwrap().as_str();
@@ -193,9 +195,11 @@ impl Test {
193195
{
194196
return Err(TestError::DuplicateGlobalVariable(global_name.to_string()));
195197
}
196-
}
197198

198-
current_source.push_str(current_line.content);
199+
Self::push_whitespace_for(&current_line, &mut current_source);
200+
} else {
201+
current_source.push_str(current_line.content);
202+
}
199203
current_source.push_str("\n");
200204

201205
Self::push_whitespace_for(&current_line, &mut prev_source);

0 commit comments

Comments
 (0)