pub enum DirectiveShape {
Bare,
Value,
NameBody,
Enum,
Import,
Main,
}Expand description
One of the five fixed shapes a #name directive can take. The shape
is determined by the directive’s name (looked up at parse time) and
drives parser dispatch + analyzer / evaluator interpretation.
Variants§
Bare
#name — no body. Example: #internal.
Value
#name <expr> — single value. Example: #default 0,
#expect "msg", #brand Color.
NameBody
#name <ident> <body-expr> — one named declaration with a
single body expression (no colon). Example:
#schema User { String name: * }. Inside a dict literal,
#schema X: { ... } retains the dict-field grammar — the :
belongs to the field separator, not the directive.
Enum
#enum Name { Variant, Variant { field: Type } } — Rust-like enum
declaration lowered to the internal tagged-enum schema shape.
Import
#import <bindspec> from <string>. Example:
#import string from "std/string",
#import * from "std/list",
#import { upper, lower as lo } from "std/string".
Main
#main(<type> <ident> [, ...]*) [-> <type>]. Example:
#main(User u, Cart cart) -> Result<Order>.
Trait Implementations§
Source§impl Clone for DirectiveShape
impl Clone for DirectiveShape
Source§fn clone(&self) -> DirectiveShape
fn clone(&self) -> DirectiveShape
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DirectiveShape
Source§impl Debug for DirectiveShape
impl Debug for DirectiveShape
impl Eq for DirectiveShape
Source§impl PartialEq for DirectiveShape
impl PartialEq for DirectiveShape
Source§fn eq(&self, other: &DirectiveShape) -> bool
fn eq(&self, other: &DirectiveShape) -> bool
self and other values to be equal, and is used by ==.