How to use the @effectful/transducers.Tag.callee function in @effectful/transducers

To help you get started, we’ve selected a few @effectful/transducers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awto / effectfuljs / packages / core / src / state.js View on Github external
sym: thisSym,
              lhs: false,
              rhs: true,
              decl: false
            });
            continue;
          case Tag.CallExpression:
            if (s.cur().type !== Tag.MemberExpression) break;
            const m = s.take();
            if (s.cur().type !== Tag.Super) {
              yield i;
              yield m;
              continue;
            }
            yield i;
            yield s.enter(Tag.callee, Tag.MemberExpression);
            yield s.enter(Tag.object, Tag.MemberExpression, m.value);
            yield* walk();
            yield* s.leave();
            s.close(m);
            yield s.tok(Tag.property, Tag.Identifier, {
              node: { name: "call" }
            });
            yield* s.leave();
            yield* s.till(i => i.pos === Tag.arguments);
            yield s.tok(Tag.push, Tag.Identifier, {
              sym: thisSym,
              lhs: false,
              rhs: true,
              decl: false
            });
            continue;
github awto / effectfuljs / packages / core / src / debug.js View on Github external
function* toExpr(pos) {
    const lab = sl.label();
    const b = sl.take();
    if (b.value.stmt) {
      yield hl(
        "expr",
        sl.enter(pos, Tag.CallExpression, { node: { arguments: [] } })
      );
      yield sl.enter(Tag.callee, Tag.FunctionExpression, {
        node: { parameters: [] }
      });
      if (b.type === Tag.BlockStatement) yield sl.peel(Kit.setPos(b, Tag.body));
      else {
        yield sl.enter(Tag.body, Tag.BlockStatement);
        yield sl.enter(Tag.body, Tag.Array);
        yield sl.peel(Kit.setPos(b, Tag.push));
      }
    } else {
      yield sl.peel(Kit.setPos(b, pos));
    }
    yield* walk();
    yield* lab();
  }
  function* toBlock(pos) {
github awto / effectfuljs / packages / core / src / debug.js View on Github external
function* walk() {
      for (const i of b.sub()) {
        switch (symName(i.type)) {
          case "jump":
            if (i.enter) {
              yield D.copyComment(i, b.enter(i.pos, Tag.CallExpression));
              yield Kit.tok(Tag.callee, Tag.Identifier, {
                node: { name: "jump" }
              });
              yield b.enter(Tag.arguments, Tag.Array);
              const d = i.value.node.dst;
              if (d != null)
                yield Kit.tok(Tag.push, Tag.StringLiteral, {
                  node: { value: i.value.node.dst.name }
                });
              yield* walk();
              yield* b.leave();
              yield* b.leave();
            }
            break;
          case "scope":
            if (i.enter) {
              yield D.copyComment(