Skip to content

Commit

Permalink
lookupRule -- remove indirect rule lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Aug 29, 2023
1 parent d2b0eb6 commit 21eca5b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
4 changes: 0 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
`lookupRule` -- remove indirect rule lookup

test -- reuqire new rules

`Cap` as special `Node` -- `Node` has optional `cap`

- with `covering` as port name
Expand Down
15 changes: 1 addition & 14 deletions src/lang/mod/lookupRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,5 @@ export function lookupRule(

const key = `${firstKey} ${secondKey}`

// With the following lookup, we will have a constraint that
// to define a rule, one of the node must be owned by this module.

const firstMod =
mod.url.href === firstNode.url.href
? mod
: mod.loader.loaded.get(firstNode.url.href)

const secondMod =
mod.url.href === secondNode.url.href
? mod
: mod.loader.loaded.get(secondNode.url.href)

return firstMod?.ruleEntries.get(key) || secondMod?.ruleEntries.get(key)
return mod.ruleEntries.get(key)
}

0 comments on commit 21eca5b

Please sign in to comment.