-
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.
importNodeRules
-- fix import rule -- only both nodes are imported
- Loading branch information
Showing
5 changed files
with
43 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
rename lookup to find | ||
|
||
# articles | ||
|
||
[docs] 反应网编程 -- 加入到 演算场 的连接 | ||
|
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,8 +1,11 @@ | ||
import { NodeWithoutId } from "../node" | ||
import { Word } from "../word" | ||
import { Mod } from "./Mod" | ||
|
||
export type RuleEntry = { | ||
name: string | ||
first: NodeWithoutId | ||
second: NodeWithoutId | ||
mod: Mod | ||
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
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,20 @@ | ||
import { NodeWithoutId } from "../node" | ||
import { Mod } from "./Mod" | ||
import { lookupDefinition } from "./lookupDefinition" | ||
|
||
export function hasNodeDefinition(mod: Mod, node: NodeWithoutId): boolean { | ||
const definition = lookupDefinition(mod, node.name) | ||
if (definition === undefined) { | ||
return false | ||
} | ||
|
||
if (definition["@kind"] !== "NodeDefinition") { | ||
return false | ||
} | ||
|
||
if (definition.mod.url.href !== mod.url.href) { | ||
return false | ||
} | ||
|
||
return true | ||
} |