-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
49 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { Def } from "../def" | ||
import { Exp } from "../exp" | ||
import { Net } from "../graph" | ||
import { Mod } from "../mod" | ||
import { Word } from "../word" | ||
|
||
export class NetDef extends Def { | ||
constructor( | ||
public mod: Mod, | ||
public name: string, | ||
public exps: Array<Exp>, | ||
public words: Array<Word>, | ||
) { | ||
super() | ||
} | ||
|
||
refer(net: Net): void { | ||
for (const exp of this.exps) { | ||
exp.apply(this.mod, net) | ||
for (const word of this.words) { | ||
word.apply(this.mod, net) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import * as Defs from "../defs" | ||
import { Exp } from "../exp" | ||
import { Mod } from "../mod" | ||
import { Word } from "../word" | ||
|
||
export class Rule { | ||
constructor( | ||
public mod: Mod, | ||
public start: Defs.NodeDef, | ||
public end: Defs.NodeDef, | ||
public exps: Array<Exp>, | ||
public words: Array<Word>, | ||
) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import * as Defs from "../defs" | ||
import { Exp } from "../exp" | ||
import { Mod } from "../mod" | ||
import { Span } from "../span" | ||
import { Stmt } from "../stmt" | ||
import { Word } from "../word" | ||
|
||
export class DefnetStmt extends Stmt { | ||
constructor( | ||
public name: string, | ||
public exps: Array<Exp>, | ||
public words: Array<Word>, | ||
public span: Span, | ||
) { | ||
super() | ||
} | ||
|
||
async execute(mod: Mod): Promise<void> { | ||
mod.define(this.name, new Defs.NetDef(mod, this.name, this.exps)) | ||
mod.define(this.name, new Defs.NetDef(mod, this.name, this.words)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { TypeBuilder } from "." | ||
import { Type } from "../type" | ||
|
||
export function buildTypes(exps: Array<string>): Array<Type> { | ||
return new TypeBuilder(exps).build() | ||
export function buildTypes(words: Array<string>): Array<Type> { | ||
return new TypeBuilder(words).build() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./Word" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.