yumemi/gen/reader/allow

allow の句を読む口。★ の Service が import gen/allow/<m> as allow で使う構成子と判定を、 allow module ごとに集める。gen/allow/<m> の生成(emit/allow)だけが使う ── model の Service には載せない(reader.gleam の subjects は root の Actor を決める分だけ)。

読むもの:

Types

pub type Usage {
  Usage(
    path: String,
    services: List(String),
    whos: List(String),
    owners: List(String),
    phase_modules: List(String),
    shorthands: List(String),
    calls: List(String),
  )
}

Constructors

  • Usage(
      path: String,
      services: List(String),
      whos: List(String),
      owners: List(String),
      phase_modules: List(String),
      shorthands: List(String),
      calls: List(String),
    )

    Arguments

    path

    “gen/allow/muse”

    services

    この allow module を as allow で import する Service の module 名

    whos

    who に書かれた構成子。初出の順

    owners

    owner に書かれた構成子(NoOwner / Self / Via<Entity>Party)。初出の順

    phase_modules

    Only([...]) の要素の module(entity/ を落とした名)。初出の順

    shorthands

    小文字の略記の句(allow.staff)

    calls

    ★ が呼ぶ判定の名(is_self / is_staff / party_of …)

Values

pub fn find(usages: List(Usage), path: String) -> Usage
pub fn owner_entity(owner: String) -> option.Option(String)

owner の名から party への道。Via<Entity>Party はその Entity の party 欄。 それ以外(NoOwner / Self)は None。

pub fn read(units: List(source.Unit)) -> List(Usage)
✨ Search Document