Token

/**
* A token.
*/

Inherit from Node

Primary key: id: int

schema Token extends Node {
  @primary id: int
}

Token::getEnclosingFunction

/**
* Gets the enclosing function of it
*/
pub fn getEnclosingFunction(self: Token) -> FunctionLikeDeclaration;

Token::getADescendant

/**
* Gets a descendant of this node. 
*/
pub fn getADescendant(self: Token) -> *Node;

Token::getRoot

/**
* Gets the root top-level of this node. 
*/
pub fn getRoot(self: Token) -> TopLevelDO;

Token::getAnAncestor

/**
* Gets an ancestor of this node. 
*/
pub fn getAnAncestor(self: Token) -> *Node;

Token::getChild

/**
* Gets the `i`th child of this node.
*/
  • Parameter self: Token
  • Parameter i: int
  • Return Node
pub fn getChild(self: Token, i: int) -> Node;

Token::getChildCount

/**
* Gets the number of child nodes.
*/
  • Parameter self: Token
  • Return int
pub fn getChildCount(self: Token) -> int;

Token::getAChild

/**
* Gets a child node of this node.
*/
pub fn getAChild(self: Token) -> *Node;

Token::getStartColumnNumber

  • Parameter self: Token
  • Return int
pub fn getStartColumnNumber(self: Token) -> int;

Token::getStartLineNumber

  • Parameter self: Token
  • Return int
pub fn getStartLineNumber(self: Token) -> int;

Token::getEndLineNumber

  • Parameter self: Token
  • Return int
pub fn getEndLineNumber(self: Token) -> int;

Token::getATrailingComment

/**
* Gets the trailing comments of it
*/
pub fn getATrailingComment(self: Token) -> *Comment;

Token::getAnAncestorByLevel

/**
* Gets an ancestor of this node by the level of the hierarchy.
*
* @param level: the number of levels to go up in the hierarchy.
*/
  • Parameter self: Token
  • Parameter level: int
  • Return Node
pub fn getAnAncestorByLevel(self: Token, level: int) -> Node;

Token::getALeadingComment

/**
* Gets the leading comments of it
*/
pub fn getALeadingComment(self: Token) -> *Comment;

Token::getFile

/**
* Gets the file of this node.
*/
pub fn getFile(self: Token) -> File;

Token::__all__

Data constraint method.

pub fn __all__(db: JavascriptDB) -> *Token;

Token::getLocation

/**
* Gets the location of this node.
*/
pub fn getLocation(self: Token) -> Location;

Token::getADescendantByLevel

/**
* Gets a descendant of this node by the level of the hierarchy.
*
* @param level: the number of levels to go up in the hierarchy.
*/
  • Parameter self: Token
  • Parameter level: int
  • Return *Node
pub fn getADescendantByLevel(self: Token, level: int) -> *Node;

Token::getModifier

/**
* Gets the `i`th modifier.
*/
pub fn getModifier(self: Token, i: int) -> Modifier;

Token::getText

/**
* Gets the text of this node.
*/
  • Parameter self: Token
  • Return string
pub fn getText(self: Token) -> string;

Token::getDecorator

/**
* Gets the `i`th decorator.
*/
pub fn getDecorator(self: Token, i: int) -> Decorator;

Token::getAComment

/**
* Gets the comments related to it
*/
pub fn getAComment(self: Token) -> *Comment;

Token::getADecorator

/**
* Gets a decorator.
*/
pub fn getADecorator(self: Token) -> *Decorator;

Token::getAModifier

/**
* Gets a modifier.
*/
pub fn getAModifier(self: Token) -> *Modifier;

Token::getKind

/**
* Get the syntax kind of this node
*/
  • Parameter self: Token
  • Return int
pub fn getKind(self: Token) -> int;

Token::getParent

/**
* Gets the parent node of this node.
*/
pub fn getParent(self: Token) -> Node;

Token::getEndColumnNumber

  • Parameter self: Token
  • Return int
pub fn getEndColumnNumber(self: Token) -> int;

Token::getLastChild

/**
* Gets the last child of this node parent.
*/
pub fn getLastChild(self: Token) -> Node;

Token::getRelativePath

/**
* Gets the relative path of this node.
*/
  • Parameter self: Token
  • Return string
pub fn getRelativePath(self: Token) -> string;

Token::getParentOid

/**
* Gets the parent oid of this node.
*/
  • Parameter self: Token
  • Return int
pub fn getParentOid(self: Token) -> int;

Token::getIndex

  • Parameter self: Token
  • Return int
pub fn getIndex(self: Token) -> int;

Token::getAnAncestorEnclosingFunction

/**
* Gets an ancestor enclosing function of it
*/
pub fn getAnAncestorEnclosingFunction(self: Token) -> *FunctionLikeDeclaration;

Token::getSymbol

/**
* Gets the symbol associated with this node.
*/
pub fn getSymbol(self: Token) -> Symbol;