QueryPrinter

io.eleven19.krueger.trees.query.QueryPrinter
object QueryPrinter

Serializes a Query back to a canonical, minimal S-expression string.

The output uses single spaces to separate tokens and omits all comments and redundant whitespace. It is guaranteed to round-trip through QueryParser.parse:

 QueryParser.parse(QueryPrinter.print(q)).isSuccess

Canonical ordering within a node:

  • Negated field constraints appear before positive field patterns.
  • Positive field patterns appear in the order given by NodePattern.fieldPatterns.
  • Unfielded child patterns (with any interspersed anchors and quantifiers) follow all field patterns.
  • Predicates are appended after the root pattern in their original order.

Attributes

Source
QueryPrinter.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods