Documentation

Position
in package

FinalYes

File, line, and column position of the parser.

Tags
psalm-immutable
psalm-external-mutation-free

Table of Contents

Properties

$column  : int
$filename  : string
$line  : int

Methods

__construct()  : mixed
advance()  : Position
column()  : int
filename()  : string
initial()  : Position
Initial position (line 1, column 1). The optional filename is the source of the input, and is really just a label to make more useful error messages.
line()  : int
pretty()  : string
Pretty print as "filename:line:column"

Properties

$column

private int $column
Tags
psalm-readonly

$filename

private string $filename
Tags
psalm-readonly

$line

private int $line
Tags
psalm-readonly

Methods

__construct()

public __construct(string $filename, int $line, int $column) : mixed
Parameters
$filename : string
$line : int
$column : int

column()

public column() : int
Return values
int

filename()

public filename() : string
Return values
string

initial()

Initial position (line 1, column 1). The optional filename is the source of the input, and is really just a label to make more useful error messages.

public static initial([string $filename = "" ]) : Position
Parameters
$filename : string = ""
Return values
Position

line()

public line() : int
Return values
int

pretty()

Pretty print as "filename:line:column"

public pretty() : string
Return values
string

        
On this page

Search results