Location¶
-
class
nestedtext.
Location
(line=None, col=None, key_line=None, key_col=None)[source]¶ Holds information about the location of a token.
Returned from
load()
andloads()
as the values in a keymap. Objects of this class holds the line and column numbers of the key and value tokens.-
as_line
(kind='value')[source]¶ Returns a string containing two lines that identify the token in context. The first line contains the line number and text of the line that contains the token. The second line contains a pointer to the token.
- Parameters
kind (str) – Specify either ‘key’ or ‘value’ depending on which token is desired.
-