summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-15 20:27:59 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-15 20:27:59 -0700
commit6912b6a6a5faf876adf04437c6bdbed5470ebc12 (patch)
treea548fe81e59ff7512a81d3fbe2ef7aa3623999a3 /parser.l
parenta4dabadfdb2c090cf985bae80c72f2c6477de046 (diff)
downloadtxr-6912b6a6a5faf876adf04437c6bdbed5470ebc12.tar.gz
txr-6912b6a6a5faf876adf04437c6bdbed5470ebc12.tar.bz2
txr-6912b6a6a5faf876adf04437c6bdbed5470ebc12.zip
Fix internal error: bug in data stream opening logic.
Test case: txr -c '@(bind x 1)A' name The problem here is that the specline has multiple elements, so when processing the bind, rest(specline) isn't nil. This means that control passes through to horizontal matching logic. No data source is open yet; just before that logic executes, open_data_source is called. However, open_data_source refuses because @(bind) is a directive that doesn't require data. So we end up in the internal error case, because we a data source, and no attempt was made to open one. The fix is for open_data_source to also check rest(specline). It cannot skip opening the data source just because the first_spec is a non-matching directive, according to the non_matching_directive_table. This criterion should only apply if it is the *only* directive, however. A spec line with multiple items must match a line of data; that's how the TXR language works. * match.c (open_data_source): Add a condition for classifying the directive as non-matching: it must be the only directive in the line (rest(specline) must be nil).
Diffstat (limited to 'parser.l')
0 files changed, 0 insertions, 0 deletions