visitBinaryExpr method

  1. @override
void visitBinaryExpr(
  1. BinaryExpr node
)
override

Implementation

@override
void visitBinaryExpr(BinaryExpr node) {
  final isNegated = node.op == _lexicon.kNotIn;
  if (node.op == _lexicon.kIn || isNegated) {
    final call = _record(
      CallExpr(
        _member(node.right, _lexicon.idContains, node),
        positionalArgs: [node.left],
        source: node.source,
        line: node.line,
        column: node.column,
        offset: node.offset,
        length: node.length,
      ),
      node,
    );
    final lowered = isNegated
        ? _record(
            UnaryPrefixExpr(
              _lexicon.logicalNot,
              call,
              source: node.source,
              line: node.line,
              column: node.column,
              offset: node.offset,
              length: node.length,
            ),
            node,
          )
        : call;
    _context.recordExpression(node, lowered);
  }
  node.subAccept(this);
}