summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-02-15 19:23:50 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-02-15 19:23:50 -0800
commitfca282dfac0b6e27c67afab2fcd8cc67a31d6c17 (patch)
tree6c2203e5ae91e05590159a0c185ed837970d3c23 /struct.c
parentdc0ecebee11c7dc7a8650efd2f8537cb1a869ad4 (diff)
downloadtxr-fca282dfac0b6e27c67afab2fcd8cc67a31d6c17.tar.gz
txr-fca282dfac0b6e27c67afab2fcd8cc67a31d6c17.tar.bz2
txr-fca282dfac0b6e27c67afab2fcd8cc67a31d6c17.zip
Support horizontal @(block), phase 2.
Accepts produce a return value which is a vector object carrying both vertical (data pointer + line number) and horizontal context (position within line). Both a vertical and horizontal @(block) construct look at this and behave in some intelligent way. * match.c (match_line_ctx): New member, data. Thus, horizontal contexts now know the vertical list from whcih they are derived. (ml_all): Take data argument, and initialize new member. (h_block): If a vector object emerges from the block, that means the block terminated due to an accept. If the accept is from a different line, or from vertical context, then just keep whatever horizontal position is current in the horizontal context. (We have no way of knowing how far we advanced between the start of the block and the elem which triggered the accept.) If the accept is from the same line then advance to the indicated position. (h_accept_fail): Produce a three-element vector object for the accept long return value. This carries the bindings, the vertical-style result value, and the horizontal position. (freeform_prepare): Update ml_all call to include c->data. (v_block): Like in h_block, handle a vector result value. An accept emanating from horizontal context for the current line causes the vertical context to advance to the next line. Horizontal accept from a different line doesn't advance the data. Accept from a vertical context behaves as before. (v_accept_fail): Produce vector object for accept. (v_trailer): When intercepting accept, patch new vector representation of accept value. (match_files): Pass c.data to ml_all.
Diffstat (limited to 'struct.c')
0 files changed, 0 insertions, 0 deletions