Skip to content

Commit

Permalink
remove Word.cut for now
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Aug 2, 2023
1 parent 0684298 commit 6bb8e2b
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 33 deletions.
17 changes: 17 additions & 0 deletions src/lang/compose/compose.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Node } from "../graph"
import { Mod } from "../mod"
import { Net } from "../net"
import { Word } from "../word"

export interface ComposeOptions {
current?: { start: Node; end: Node }
}

export function compose(
mod: Mod,
net: Net,
word: Word,
options?: ComposeOptions,
): void {
//
}
16 changes: 16 additions & 0 deletions src/lang/cut/cut.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Ctx } from "../ctx"
import { Mod } from "../mod"
import { Word } from "../word"

export interface CutOptions {
//
}

export function cut(
mod: Mod,
ctx: Ctx,
word: Word,
options?: CutOptions,
): void {
//
}
6 changes: 3 additions & 3 deletions src/lang/cut/cutWords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Mod } from "../mod"
import { Word } from "../word"

export function cutWords(mod: Mod, ctx: Ctx, words: Array<Word>): void {
for (const word of words) {
word.cut(mod, ctx)
}
// for (const word of words) {
// word.cut(mod, ctx)
// }
}
6 changes: 0 additions & 6 deletions src/lang/word/Word.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Ctx } from "../ctx"
import { Node } from "../graph"
import { Mod } from "../mod"
import { Net } from "../net"
Expand All @@ -8,12 +7,7 @@ export interface ComposeOptions {
current?: { start: Node; end: Node }
}

export interface CutOptions {
//
}

export interface Word {
span: Span
compose(mod: Mod, net: Net, options?: ComposeOptions): void
cut(mod: Mod, ctx: Ctx, options?: CutOptions): void
}
7 changes: 1 addition & 6 deletions src/lang/words/Call.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Ctx } from "../ctx"
import { Mod } from "../mod"
import { lookupDefinitionOrFail } from "../mod/lookupDefinitionOrFail"
import { Net } from "../net"
import { Span } from "../span"
import { CutOptions, Word } from "../word"
import { Word } from "../word"

export class Call implements Word {
constructor(
Expand All @@ -20,8 +19,4 @@ export class Call implements Word {
lookupDefinitionOrFail(mod, this.name).compose(net)
}
}

cut(mod: Mod, ctx: Ctx, options?: CutOptions): void {
//
}
}
7 changes: 1 addition & 6 deletions src/lang/words/LocalSet.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Ctx } from "../ctx"
import { Mod } from "../mod"
import { Net } from "../net"
import { Span } from "../span"
import { CutOptions, Word } from "../word"
import { Word } from "../word"

export class LocalSet implements Word {
constructor(
Expand All @@ -20,8 +19,4 @@ export class LocalSet implements Word {

net.localPorts.set(this.name, port)
}

cut(mod: Mod, ctx: Ctx, options?: CutOptions): void {
//
}
}
7 changes: 1 addition & 6 deletions src/lang/words/PortPush.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Ctx } from "../ctx"
import { findPortInNodes } from "../graph/findPortInActiveEdge"
import { Mod } from "../mod"
import { Net } from "../net"
import { disconnect } from "../net/disconnect"
import { Span } from "../span"
import { ComposeOptions, CutOptions, Word } from "../word"
import { ComposeOptions, Word } from "../word"

export class PortPush implements Word {
constructor(
Expand Down Expand Up @@ -41,8 +40,4 @@ export class PortPush implements Word {

net.ports.push(found)
}

cut(mod: Mod, ctx: Ctx, options?: CutOptions): void {
//
}
}
7 changes: 1 addition & 6 deletions src/lang/words/PortReconnect.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Ctx } from "../ctx"
import { findPortInNodes } from "../graph/findPortInActiveEdge"
import { Mod } from "../mod"
import { Net } from "../net"
import { connect } from "../net/connect"
import { disconnect } from "../net/disconnect"
import { Span } from "../span"
import { ComposeOptions, CutOptions, Word } from "../word"
import { ComposeOptions, Word } from "../word"

export class PortReconnect implements Word {
constructor(
Expand Down Expand Up @@ -48,8 +47,4 @@ export class PortReconnect implements Word {

connect(net, topPort, found)
}

cut(mod: Mod, ctx: Ctx, options?: CutOptions): void {
//
}
}

0 comments on commit 6bb8e2b

Please sign in to comment.