NFunctionDecl

NodeAstNodeNExprloreline.NFunctionDecl (Class)

Represents a callable function in the AST

Instance Members

name: Null<String>

The function name (if any)


args: Array<String>

Argument names


code: String

The actual code of the function (including the signature)


external: Bool

Whether this is an external function (so this is only a declaration without implementation)


type(): String
Returns
String

toJson(): Dynamic

Converts the literal to a JSON representation.

Returns Description
Dynamic Dynamic object containing literal data

new(id: NodeId, pos: Position, name: Null<String>, args: Array<String>, code: String, external: Bool, ?leadingComments: Array<Comment>, ?trailingComments: Array<Comment>): Void

Creates a new function node.

Name Type Default Description
id NodeId
pos Position Position in source where this function appears
name Null<String> The function name (if any)
args Array<String> Argument names
code String The actual code of the function (including the signature)
external Bool Whether this is an external function (so this is only a declaration without implementation)
leadingComments Array<Comment> (optional) Optional comments before the function
trailingComments Array<Comment> (optional) Optional comments after the function

Metadata

Name Parameters
:hxGen -