OxL Справочник OxL
РусскийEnglish

kw is

Зарезервированное слово

Список слов: §1.4

Синтаксис

ebnf
Postfix     = Primary { "(" [ Args ] ")" [ TrailingBlock ] | "[" Expr "]" | "." ( Ident | IntLit | "[" Expr "]" )
            | "?." Ident | "?" | "!" | "as" Type | "is" Type } ;

Грамматика: Прил. A

Определяется в

Примеры

oxl
let kind = if n < 0 { "neg" } else if n == 0 { "zero" } else { "pos" }
if let User{ role: .Admin, name, .. } = u { greet(name) }
if x is Receipt { save(x) }          // x сужен до Receipt

— 5.4 Условия

oxl
policy Orders {
  allow get(id)        if caller.isUser(db.find(Order, id)?.userId)
  allow list, recent   if caller.has(role: .Support)
  allow *              if caller.service("billing")
  deny  delete         unless caller.has(role: .Admin) && caller is .User(mfa: true, ..)
}

@public rpc health() -> Ok
@allow(role: .Admin) rpc purge() -> Ok
@internal rpc create(…) -> Order

— 13.4 Авторизация и политики

Связанные диагностики

chained-comparison, type-mismatch, data-rights, missing-policy, unknown-policy-target, not-callable, not-overloadable, operator-decl, range-not-iterable, fail-type, question-context, unhandled-error, fixture-yield

См. также