Ignore comments in Tree-sitter logic graphs
This commit is contained in:
parent
9161889492
commit
6d659ba381
2 changed files with 46 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ from tree_sitter import Language, Node, Parser
|
|||
from .errors import DocForgeError
|
||||
from .models import LogicEdge, LogicNode, LogicProjection
|
||||
|
||||
_TRIVIA_NODE_TYPES = frozenset({"comment"})
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TreeSitterLogicOwner:
|
||||
|
|
@ -432,6 +434,8 @@ class _TreeSitterFunctionBuilder:
|
|||
*,
|
||||
control: _Control | None,
|
||||
) -> tuple[_Tail, ...]:
|
||||
if statement.type in _TRIVIA_NODE_TYPES:
|
||||
return incoming
|
||||
if statement.type in self.profile.block_types:
|
||||
return self._statements(statement.named_children, incoming, control=control)
|
||||
if statement.type == "if_statement":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue