tightened up parsing of $field=X record constructor expressions

This commit is contained in:
Vern Paxson 2025-08-31 15:14:26 -07:00
parent d20550f553
commit 36862a18d6
4 changed files with 51 additions and 22 deletions

View file

@ -0,0 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/bogus-field-assign.zeek, line 6: syntax error, at or near "$"

View file

@ -1,2 +1,2 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/record-bad-ctor3.zeek, line 13: bad type in record constructor ([$x=a + 5, a + 9] and a + 9)
error in <...>/record-bad-ctor3.zeek, line 13: syntax error, at or near "a"

View file

@ -0,0 +1,6 @@
# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
# Zeek used to happily print the value of "5" here.
print $foo=5;