Home Reference Source Repository
import {Pos} from 'esast/src/Loc.js'
public class | source

Pos

You can directly use instance of this class. StartPos

Represents a single location in the source string.

Constructor Summary

Public Constructor
public

constructor(line: *, column: *)

Member Summary

Public Members
public

column: *

public

line: *

Method Summary

Public Methods
public

next(ch: *): *

Advance the pos by any character.
public
Loc after a non-newline character.
public

onNextLine(): *

Poc after a newline.
public
Undoes {@link onNextLine}.
public

Public Constructors

public constructor(line: *, column: *) source

Params:

NameTypeAttributeDescription
line *
column *

Public Members

public column: * source

public line: * source

Public Methods

public next(ch: *): * source

Advance the pos by any character.

Params:

NameTypeAttributeDescription
ch *

Return:

*

public onNextColumn(): * source

Loc after a non-newline character.

Return:

*

public onNextLine(): * source

Poc after a newline.

Return:

*

public onPrevColumn(): * source

Undoes onNextLine. Only call this is you know this is not the first column.

Return:

*

public toString(): string source

Return:

string