MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / is_keyword_boundary

Function is_keyword_boundary

src/classmap_scanner.rs:1617–1636  ·  view source on GitHub ↗
(content: &[u8], i: usize)

Source from the content-addressed store, hash-verified

1615/// `$node?->class` to avoid false positives.
1616#[inline]
1617fn is_keyword_boundary(content: &[u8], i: usize) -> bool {
1618 if i == 0 {
1619 return true;
1620 }
1621
1622 let prev = content[i - 1];
1623 if !is_boundary_char(prev) {
1624 return false;
1625 }
1626
1627 // Reject object/nullsafe property access: ->class, ?->class
1628 if prev == b'>' && i >= 2 {
1629 let prev2 = content[i - 2];
1630 if prev2 == b'-' || prev2 == b'?' {
1631 return false;
1632 }
1633 }
1634
1635 true
1636}
1637
1638/// Read the constant name from the first argument of a `define()` call.
1639///

Callers 2

find_symbolsFunction · 0.85
find_classesFunction · 0.85

Calls 1

is_boundary_charFunction · 0.85

Tested by

no test coverage detected