A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::flow::syntax::Location Struct Reference

Where a piece of syntax starts, reduced to what every reader of it needs. More...

#include <cpp/a11/flow/syntax.h>

Public Attributes

size_t start = 0
 
size_t end = 0
 
int line = 1
 
int column = 1
 

Detailed Description

Where a piece of syntax starts, reduced to what every reader of it needs.

The span of the token the construct began at, not of the whole construct – the same thing a11/flow/syntax.py keeps, and what a diagnostic wants to point at. A frontend that needs the full extent of a statement has the token stream.

A node carries this rather than the [Token] it was made from, because the AST outlives the token stream: a token borrows the source text, and a tree that borrowed it could not be handed across a language boundary or kept while the document changed underneath. Offsets are bytes, so an editor can edit with them; line and column count code points, as everything in the language does.

Member Data Documentation

◆ column

int a11::flow::syntax::Location::column = 1

◆ end

size_t a11::flow::syntax::Location::end = 0

◆ line

int a11::flow::syntax::Location::line = 1

◆ start

size_t a11::flow::syntax::Location::start = 0

The documentation for this struct was generated from the following file: