up: Z     index Zimbu documentation

CLASS Z.Pos @public

summary

     

Class that stores the line/column position in a file.

The filename is expected to be relative to the current directory or an absolute path. This is not enforced.

string  $filename @public  name of the file
int  $lnum @public  first line is 1
int  $col @public  first column is 1
string  $text @public  optional text
 
NEW(filename) @public  Create a position for file filename, line 1 column 1.
NEW(filename, lnum, col) @public  Create a position for file filename, line lnum column col.
$copy() Z.Pos @public  Return a copy of this Pos.
$copy(dest) @public  Copy the values of this Pos to dest.
$nextLine() @public  Advance this position to the next line, first column.
$advance(s) @public  Adjust the position for advancing over string s.
$ToString() string @public  Return a string with the file name, line and column.
 

members (alphabetically)

     

int $col @public

     

first column is 1

string $filename @public

     

name of the file

int $lnum @public

     

first line is 1

string $text @public

     

optional text

PROC NEW(string filename) @public

     

Create a position for file filename, line 1 column 1.

PROC NEW(string filename, int lnum, int col) @public

     

Create a position for file filename, line lnum column col.

FUNC $ToString() string @public

     

Return a string with the file name, line and column.

Example: "zimbu.zu line 234 col 23" This is a standard format that is understood by programs that parse compiler errors.

PROC $advance(string s) @public

     

Adjust the position for advancing over string s.

FUNC $copy() Z.Pos @public

     

Return a copy of this Pos.

PROC $copy(Z.Pos dest) @public

     

Copy the values of this Pos to dest.

PROC $nextLine() @public

     

Advance this position to the next line, first column.

license

      Copyright 2010 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0