aac.context.source_location

Parser Metadata class use to manage and identify the location of definitions in the source YAML.

Classes

SourceLocation(line, column, position, span)

The position and span of an AaC structure in the YAML source.

class aac.context.source_location.SourceLocation(line: int, column: int, position: int, span: int)[source]

The position and span of an AaC structure in the YAML source.

Parameters:
  • line (int)

  • column (int)

  • position (int)

  • span (int)

line

The line number on which the object was found.

Type:

int

column

The character position at which the object was found.

Type:

int

position

The position relative to the start of the file where the object was found.

Type:

int

span

The number of characters occupied by the object relative to position.

Type:

int

to_tuple() tuple[int, int, int, int][source]

Return a representation of the location as a tuple.

Returns:

An (int, int, int, int) tuple consisting of the line number, column, character start, and the span.

Return type:

tuple[int, int, int, int]