MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / check_next_node_same_line

Function check_next_node_same_line

src/cst/mod.rs:2527–2547  ·  view source on GitHub ↗
(trailing_comma: &CstToken)

Source from the content-addressed store, hash-verified

2525
2526fn remove_comma_separated(node: CstNode) {
2527 fn check_next_node_same_line(trailing_comma: &CstToken) -> bool {
2528 for sibling in trailing_comma.next_siblings() {
2529 match sibling {
2530 CstNode::Container(_) => return true,
2531 CstNode::Leaf(n) => match n {
2532 CstLeafNode::BooleanLit(_)
2533 | CstLeafNode::NullKeyword(_)
2534 | CstLeafNode::NumberLit(_)
2535 | CstLeafNode::StringLit(_)
2536 | CstLeafNode::WordLit(_)
2537 | CstLeafNode::Token(_) => return true,
2538 CstLeafNode::Whitespace(_) | CstLeafNode::Comment(_) => {
2539 // keep going
2540 }
2541 CstLeafNode::Newline(_) => return false,
2542 },
2543 }
2544 }
2545
2546 true
2547 }
2548
2549 let parent = node.parent();
2550 let trailing_comma = node.trailing_comma();

Callers 1

remove_comma_separatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…