NLiteral

NodeAstNodeNExprloreline.NLiteral (Class)

Represents literal values in the AST (numbers, booleans, arrays, objects).

Instance Members

value: Any

The literal value.


literalType: Anonymous

Type of the literal value.


type(): String
Returns
String

each(handleNode: Function): Void
Name Type
handleNode Function

toJson(): Dynamic

Converts the literal to a JSON representation.

Returns Description
Dynamic Dynamic object containing literal data

new(id: NodeId, pos: Position, value: Any, literalType: Anonymous, ?leadingComments: Array<Comment>, ?trailingComments: Array<Comment>): Void

Creates a new literal node.

Name Type Default Description
id NodeId
pos Position Position in source where this literal appears
value Any The literal value
literalType Anonymous
leadingComments Array<Comment> (optional) Optional comments before the literal
trailingComments Array<Comment> (optional) Optional comments after the literal