In its answer to this question, hkaiser said he would write an example of a token type which carries code position information. I really cannot find anything about this.
Can anyone point me to such an example ?
In its answer to this question, hkaiser said he would write an example of a token type which carries code position information. I really cannot find anything about this.
Can anyone point me to such an example ?
He was probably referring to position_token
, which did in fact get released, although there's little documentation. This SO question has good coverage of its usage.
position_token
has methods begin()
and end()
which return iterators to the start and end of the underlying input that they matched. You could use this, for example, to determine the byte offset, within a file, of the matched input. –
Graff line_pos_iterator
. –
Shoestring line_pos_iterator
seems to be for character-based input –
Graff position_token
and line_pos_iterator
. –
Shoestring © 2022 - 2024 — McMap. All rights reserved.