Skip to main content

yog_script_analyze/words/
interface.rs

1//! `interface` — what a type promises.
2
3use crate::ast::DeclKind;
4use crate::parser::{PResult, Parser};
5use crate::words::{Role, Word, class};
6
7pub static WORD: Word = Word {
8    text: "interface",
9    doc: "What a type promises: `interface IChargeable { Energy Room { get; } }`. Types, content and \
10          patched classes (`add : IChargeable;`) implement it; it inherits any interfaces and may give members bodies.",
11    reserved: true,
12    roles: &[Role::Decl { starts: None, parse }],
13};
14
15fn parse(p: &mut Parser) -> PResult<DeclKind> {
16    class::type_decl(p, class::Form::Promise)
17}