Add p_set_position()

This commit is contained in:
josh committed 2026-07-11 22:46:21 -04:00
1 parent fb4288d5b9
commit c0016f6d58
8 files changed
+218

No files matched your search

+17
View File
@@ -1346,6 +1346,23 @@ size_t <%= @grammar.prefix %>parse_inner_<%= start_rule %>(<%= @grammar.prefix %
return context->text_position;
}
/**
* Set the current text input position.
*
* This can be used to set the initial text position to something other than
* (1, 1) for a nested parse operation so that error positions reported by
* subsequent lexer/parser calls are relative to a larger enclosing document.
*
* @param context
* Lexer/parser context structure.
* @param position
* Text position to set.
*/
void <%= @grammar.prefix %>set_position(<%= @grammar.prefix %>context_t * context, <%= @grammar.prefix %>position_t position)
{
context->text_position = position;
}
/**
* Get the user terminate code.
*