|
Bond 0.9
C++ Bond Runtime Library API Documentation
|
A POD struct to contain the index, line and column of a token in source code. More...
#include <bond/compiler/streampos.h>
Public Member Functions | |
| StreamPos (size_t i=0, size_t l=1, size_t c=1) | |
| Constructs a StreamPos object. | |
| StreamPos (const StreamPos &other)=default | |
| Constructs a copy of another StreamPos. | |
Public Attributes | |
| size_t | index |
| The byte offset into the source. | |
| size_t | line |
| The 1-based line number. | |
| size_t | column |
| The 1-based column number, counted in code points. | |
A POD struct to contain the index, line and column of a token in source code.
The index is a byte offset into the UTF-8 source. Lines and columns are 1-based, and columns count code points rather than bytes, so they match what an editor shows for most text. Stray UTF-8 continuation bytes, which are invalid, do not advance the column.
|
inline |
Constructs a StreamPos object.
| i | The byte offset into the source. |
| l | The 1-based line number. |
| c | The 1-based column number. |
|
default |
Constructs a copy of another StreamPos.
| size_t Bond::StreamPos::column |
The 1-based column number, counted in code points.
| size_t Bond::StreamPos::index |
The byte offset into the source.
| size_t Bond::StreamPos::line |
The 1-based line number.