Skip to content

Commit

Permalink
extract run/
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Aug 1, 2023
1 parent 6c25698 commit b2e3270
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/lang/definitions/NodeDefinition.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Definition } from "../definition"
import { Net, Node } from "../graph"
import { PortExp } from "../graph/PortExp"
import { connect } from "../graph/connect"
import { createNode } from "../graph/createNode"
import { Mod } from "../mod"
import { connect } from "../run/connect"

export class NodeDefinition implements Definition {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/lang/graph/composeWords.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cleanUpWires } from "../graph/cleanUpWires"
import { Mod } from "../mod"
import { cleanUpWires } from "../run/cleanUpWires"
import { Word } from "../word"
import { Net } from "./Net"

Expand Down
2 changes: 1 addition & 1 deletion src/lang/mod/defineBuiltInOperators.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Port } from "../graph"
import { connect } from "../graph/connect"
import { createNode } from "../graph/createNode"
import { Mod } from "../mod"
import { connect } from "../run/connect"
import * as Types from "../type"
import { defineOperator } from "./defineOperator"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Net } from "./Net"
import { Net } from "../graph/Net"
import { connect } from "./connect"
import { disconnect } from "./disconnect"
import { removeNode } from "./removeNode"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Definitions from "../definitions"
import { Net } from "./Net"
import { Node } from "./Node"
import { Net } from "../graph/Net"
import { Node } from "../graph/Node"

/*
Expand Down
4 changes: 2 additions & 2 deletions src/lang/graph/connect.ts → src/lang/run/connect.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Net } from "../graph/Net"
import { Port } from "../graph/Port"
import { lookupRuleByPorts } from "../mod/lookupRuleByPorts"
import { Net } from "./Net"
import { Port } from "./Port"

export function connect(net: Net, start: Port, end: Port): void {
const rule = lookupRuleByPorts(net.mod, start, end)
Expand Down
4 changes: 2 additions & 2 deletions src/lang/graph/disconnect.ts → src/lang/run/disconnect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Edge } from "./Edge"
import { Net } from "./Net"
import { Edge } from "../graph/Edge"
import { Net } from "../graph/Net"
import { removeEdge } from "./removeEdge"

export function disconnect(net: Net, edge: Edge): void {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InternalError } from "../errors"
import { Net } from "./Net"
import { Node } from "./Node"
import { Net } from "../graph/Net"
import { Node } from "../graph/Node"
import { disconnect } from "./disconnect"
import { removeNode } from "./removeNode"

Expand Down
4 changes: 2 additions & 2 deletions src/lang/graph/removeEdge.ts → src/lang/run/removeEdge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Edge } from "./Edge"
import { Net } from "./Net"
import { Edge } from "../graph/Edge"
import { Net } from "../graph/Net"

export function removeEdge(net: Net, edge: Edge): void {
const index = net.edges.indexOf(edge)
Expand Down
4 changes: 2 additions & 2 deletions src/lang/graph/removeNode.ts → src/lang/run/removeNode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Net } from "./Net"
import { Node } from "./Node"
import { Net } from "../graph/Net"
import { Node } from "../graph/Node"

export function removeNode(net: Net, node: Node): void {
const index = net.nodes.indexOf(node)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lang/graph/run.ts → src/lang/run/run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Net } from "./Net"
import { Net } from "../graph/Net"
import { cleanUpWires } from "./cleanUpWires"
import { closeFreePorts } from "./closeFreePorts"
import { interact } from "./interact"
Expand Down
2 changes: 1 addition & 1 deletion src/lang/stmts/Run.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { formatNet } from "../format"
import { composeWords } from "../graph/composeWords"
import { createNet } from "../graph/createNet"
import { run } from "../graph/run"
import { Mod } from "../mod"
import { run } from "../run/run"
import { Span } from "../span"
import { Stmt } from "../stmt"
import { Word } from "../word"
Expand Down
2 changes: 1 addition & 1 deletion src/lang/words/PortPush.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Net } from "../graph"
import { disconnect } from "../graph/disconnect"
import { findPortInActiveEdge } from "../graph/findPortInActiveEdge"
import { Mod } from "../mod"
import { disconnect } from "../run/disconnect"
import { Span } from "../span"
import { Word, WordOptions } from "../word"

Expand Down
4 changes: 2 additions & 2 deletions src/lang/words/PortReconnect.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Net } from "../graph"
import { connect } from "../graph/connect"
import { disconnect } from "../graph/disconnect"
import { findPortInActiveEdge } from "../graph/findPortInActiveEdge"
import { Mod } from "../mod"
import { connect } from "../run/connect"
import { disconnect } from "../run/disconnect"
import { Span } from "../span"
import { Word, WordOptions } from "../word"

Expand Down

0 comments on commit b2e3270

Please sign in to comment.