[][src]Struct zypo_lib::parser::ast::Function

pub struct Function {
    pub ident: String,
    pub params: Vec<Parameter>,
    pub body: Vec<StatementNode>,
    pub docs: Option<String>,
    pub return_type: VarType,
}

A function statement, the basis for the whole language.

Syntax example

fun number_adder(first_num: int, second_num: int) -> int {
    --snip--
}

Fields

ident: String

Function identifier.

params: Vec<Parameter>

Parameters declared inside of the function signature.

body: Vec<StatementNode>

The main body inside of the function.

docs: Option<String>

A markdown-compatible String that is a documenation comment.

NOTE: This may be bound to a trait in the future to extend to other datatypes.

return_type: VarType

Expected return type inside of the function signature.

Trait Implementations

impl PartialEq<Function> for Function[src]

impl Debug for Function[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]