Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TokenIterator

This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens.

Hierarchy

  • TokenIterator

Index

Constructors

constructor

  • Creates a new token iterator object. The inital token index is set to the provided row and column coordinates.

    Parameters

    • session: EditSession

      The session to associate with

    • initialRow: Number

      The row to start the tokenizing at

    • initialColumn: Number

      The column to start the tokenizing at

    Returns TokenIterator

Methods

getCurrentToken

  • getCurrentToken(): Token

getCurrentTokenColumn

  • getCurrentTokenColumn(): number

getCurrentTokenPosition

  • getCurrentTokenPosition(): Point

getCurrentTokenRange

  • getCurrentTokenRange(): Range

getCurrentTokenRow

  • getCurrentTokenRow(): number

stepBackward

  • Tokenizes all the items from the current point to the row prior in the document.

    Returns Token

    If the current point is not at the top of the file, this function returns null. Otherwise, it returns an array of the tokenized strings.

stepForward

  • Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns null. Otherwise, it returns the tokenized string.

    Returns Token

Generated using TypeDoc