Skip to content

Commit

Permalink
mv PortExp to graph/
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Aug 1, 2023
1 parent fcbd67e commit 37f485b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# type

mv `PortExp` to `graph`

`PortExp` take `type`

`freshenTypes` -- consistently add subscript to type variable names
Expand Down
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 { PortExp } from "../stmts"

export class NodeDefinition implements Definition {
constructor(
Expand Down
4 changes: 4 additions & 0 deletions src/lang/graph/PortExp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type PortExp = {
name: string
isPrincipal: boolean
}
2 changes: 1 addition & 1 deletion src/lang/graph/createNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Node } from "../graph"
import { Mod } from "../mod"
import { PortExp } from "../stmts"
import * as Types from "../type"
import { PortExp } from "./PortExp"
import { createPort } from "./createPort"

export function createNode(
Expand Down
6 changes: 1 addition & 5 deletions src/lang/stmts/Defnode.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import * as Definitions from "../definitions"
import { PortExp } from "../graph/PortExp"
import { Mod } from "../mod"
import { define } from "../mod/define"
import { Span } from "../span"
import { Stmt } from "../stmt"

export type PortExp = {
name: string
isPrincipal: boolean
}

export class Defnode implements Stmt {
constructor(
public name: string,
Expand Down
2 changes: 1 addition & 1 deletion src/lang/syntax/matchers/port_matcher.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as pt from "@cicada-lang/partech"
import { PortExp } from "../../stmts"
import { PortExp } from "../../graph/PortExp"

export function port_matcher(tree: pt.Tree): PortExp {
return pt.matcher<PortExp>({
Expand Down

0 comments on commit 37f485b

Please sign in to comment.