Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions syntaqlite-syntax/csrc/parser_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ typedef struct SynqExpansionLayer {

// Position of this nested call in the *parent's authored body*,
// computed by inverting the length shifts from the parent's $param
// substitutions. body_call_length == 0 means the call was tokenized
// from a substituted arg's text (no clean body position) and consumers
// should descend through the matching arg segment instead. Zero for
// top-level layers (parent_layer_id == 0).
// substitutions. Both fields equal SYNTAQLITE_MACRO_BODY_CALL_ARG_INTERNAL
// (UINT32_MAX) when the call was tokenized from a substituted arg's
// text (no clean body position) and consumers should descend through
// the matching arg segment instead. Zero for top-level layers
// (parent_layer_id == 0).
uint32_t body_call_offset;
uint32_t body_call_length;

Expand Down
7 changes: 4 additions & 3 deletions syntaqlite-syntax/include/syntaqlite/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,10 @@ typedef struct SyntaqliteMacroRewrite {
uint32_t def_col;
// Position of this call in the *parent's authored body*, computed by
// inverting the length shifts the parent's $param substitutions
// introduced. body_call_length == 0 means the call was tokenized
// from a substituted arg's text (no meaningful body position) and
// consumers should descend through the matching arg segment instead.
// introduced. Both fields equal SYNTAQLITE_MACRO_BODY_CALL_ARG_INTERNAL
// (UINT32_MAX) when the call was tokenized from a substituted arg's
// text (no meaningful body position) and consumers should descend
// through the matching arg segment instead.
//
// For top-level rewrites (parent_idx == SYNTAQLITE_MACRO_PARENT_SOURCE)
// the parent is the authored source, so these equal call_offset /
Expand Down
3 changes: 2 additions & 1 deletion syntaqlite-syntax/src/parser/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,8 @@ mod tests {
//
// The inner n!(...) call is tokenized from the substituted text
// of m's $x, not from m's authored body — downstream Rewriter
// consumers need body_call_length == 0 to signal "descend via
// consumers need the arg-internal sentinel (u32::MAX on both
// body_call_offset and body_call_length) to signal "descend via
// arg segments" instead of "rewrite in the parent's body".
let mut parser = Parser::with_config(&ParserConfig::default().with_macro_fallback(true));
let mut reg = TestMacroRegistry::new();
Expand Down
Loading