Skip to content

Commit

Permalink
rename placeholder/create* to placeholder/add*
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Aug 15, 2023
1 parent 10dc92f commit a5e58fd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 0 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# net -- graph theory

rename `placeholder/create*` to `placeholder/add*`

`Node` should not `input` and `output` ports

[maybe] `ActiveEdge` should not have `rule` -- all edges are the same
Expand Down
4 changes: 2 additions & 2 deletions src/lang/check/checkWords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { compose } from "../compose/compose"
import { createEnv } from "../env/createEnv"
import { freshenType } from "../freshen/freshenType"
import { Mod } from "../mod"
import { createPlaceholderOutputPortFromType } from "../placeholder/createPlaceholderOutputPortFromType"
import { addPlaceholderOutputPortFromType } from "../placeholder/addPlaceholderOutputPortFromType"
import { unifyTypes } from "../unify/unifyTypes"
import { formatValue } from "../value/formatValue"
import { Word } from "../word"
Expand All @@ -25,7 +25,7 @@ export function checkWords(

const placeholderOutputPorts = inputValues
.reverse()
.map((t) => createPlaceholderOutputPortFromType(env.net, mod, t))
.map((t) => addPlaceholderOutputPortFromType(env.net, mod, t))

env.stack.push(...placeholderOutputPorts)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Net } from "../net"
import { addNode } from "../net/addNode"
import { Port } from "../port"

export function createPlaceholderInputPortForPort(
export function addPlaceholderInputPortForPort(
net: Net,
mod: Mod,
port: Port,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Net } from "../net"
import { addNode } from "../net/addNode"
import { Port } from "../port"

export function createPlaceholderOutputPortForPort(
export function addPlaceholderOutputPortForPort(
net: Net,
mod: Mod,
port: Port,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { addNode } from "../net/addNode"
import { Port } from "../port"
import { Value } from "../value"

export function createPlaceholderOutputPortFromType(
export function addPlaceholderOutputPortFromType(
net: Net,
mod: Mod,
t: Value,
Expand Down
8 changes: 4 additions & 4 deletions src/lang/placeholder/connectNodeWithPlaceholderPorts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { connect } from "../connect/connect"
import { Mod } from "../mod"
import { Net } from "../net"
import { Node } from "../node"
import { createPlaceholderInputPortForPort } from "./createPlaceholderInputPortForPort"
import { createPlaceholderOutputPortForPort } from "./createPlaceholderOutputPortForPort"
import { addPlaceholderInputPortForPort } from "./addPlaceholderInputPortForPort"
import { addPlaceholderOutputPortForPort } from "./addPlaceholderOutputPortForPort"

export function connectNodeWithPlaceholderPorts(
mod: Mod,
Expand All @@ -12,14 +12,14 @@ export function connectNodeWithPlaceholderPorts(
): void {
for (const port of node.input) {
if (!port.isPrincipal) {
const placeholderPort = createPlaceholderOutputPortForPort(net, mod, port)
const placeholderPort = addPlaceholderOutputPortForPort(net, mod, port)
connect(net, port, placeholderPort)
}
}

for (const port of node.output) {
if (!port.isPrincipal) {
const placeholderPort = createPlaceholderInputPortForPort(net, mod, port)
const placeholderPort = addPlaceholderInputPortForPort(net, mod, port)
connect(net, port, placeholderPort)
}
}
Expand Down

0 comments on commit a5e58fd

Please sign in to comment.