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 を決める分だけ)。
読むもの:
service定数のallow: [...]の各句。Clause(who:, at:, owner:)の構成子名と、Only([...])の要素の module(= その phase を持つ Entity)- 略記の句。大文字(
allow.Anyone)は who の名、小文字(allow.staff)は句の定数 - module 全体(コメントを除く)の
allow.<name>(の呼び出し ──is_self/is_<entity>/party_of
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 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)