LeafKit Documentation

Structure Leaf​Context

public struct LeafContext  

Properties

parameters

public let parameters: [LeafData] 

data

public let data: [String: LeafData] 

body

public let body: [Syntax]? 

user​Info

public let userInfo: [AnyHashable: Any] 

Methods

require​Parameter​Count(_:​)

public func requireParameterCount(_ n: Int) throws  

Throws an error if the parameter count does not equal the supplied number n.

require​Body()

public func requireBody() throws -> [Syntax]  

Throws an error if this tag does not include a body.

require​NoBody()

public func requireNoBody() throws  

Throws an error if this tag includes a body.