Package 

Class AstMatcherDslAdapterKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final MatchingConfig<Node> getDefaultMatchingConfig()
      final static <N extends Node> Function1<TreeNodeWrapper<Node, out N>, Unit> ignoreResult(Function1<TreeNodeWrapper<Node, out N>, ?> $self)
      final static <N extends Node> Unit shouldMatchNode(Node $self, Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, out N>, ?> nodeSpec) A shorthand for baseShouldMatchSubtree providing the NodeTreeLikeAdapter.
      final static <N extends Node> Function1<Node, Unit> matchNode(Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, out N>, ?> nodeSpec) Returns an assertion function asserting that its parameter conforms to the given NodeSpec.
      final static Unit shouldMatchN(Node $self, Function1<TreeNodeWrapper<Node, out Node>, out Object> matcher) The spec applies to the parent, shifted so that this node is the first node to be queried.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • ignoreResult

         final static <N extends Node> Function1<TreeNodeWrapper<Node, out N>, Unit> ignoreResult(Function1<TreeNodeWrapper<Node, out N>, ?> $self)
      • matchNode

         final static <N extends Node> Function1<Node, Unit> matchNode(Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, out N>, ?> nodeSpec)

        Returns an assertion function asserting that its parameter conforms to the given NodeSpec.

        Use it with io.kotest.matchers.should, e.g. node should matchNode<ASTExpression> {}.

        See also the samples on TreeNodeWrapper.

        Parameters:
        ignoreChildren - If true, calls to TreeNodeWrapper.child in the nodeSpec are forbidden.
        nodeSpec - Sequence of assertions to carry out on the node, which can be referred to by TreeNodeWrapper.it.
      • shouldMatchN

         final static Unit shouldMatchN(Node $self, Function1<TreeNodeWrapper<Node, out Node>, out Object> matcher)

        The spec applies to the parent, shifted so that this node is the first node to be queried. This allows using sweeter DSL constructs like in the Java module.