public DeclarationNode( kind as DeclarationKind, name as String, signature as String, range as SourceRange, visibility as String = "", returnType as String = "", docComment as String = "" )
Constructs a DeclarationNode.
| Parameter | Description |
|---|---|
kind | Structural kind of declaration. |
name | Simple identifier name of the symbol. |
signature | Full header/signature text of the declaration. |
range | Source range spanned by the declaration. |
visibility | Visibility modifier ("public", "protected", "private", or ""). |
returnType | Declared return or value type (or ""). |
docComment | Associated documentation comment text (or ""). |
import klyn.code.ast node = DeclarationNode(DeclarationKind.FUNCTION, "compute", "def compute(x as Int) as Int", SourceRange(0, 0, 4, 0), "public", "Int") assert node.name == "compute"