The following grammar fails to parse since field S.b consumes all available input:
module skip;
type S = unit(size: uint64) {
a : bytes &size=2;
b : skip bytes &size=1;
c : bytes &size=1;
d : skip bytes &eod;
on %done {
print self;
}
} &size=size;
public type X = unit {
: S(6);
};
This has been broken since at least the introduction of this skip syntax in e134dc41e34bf339dd9827ce46cc652865f606bb, i.e., likely since the skip feature came about.
This was originally reported privately by @Mohan-Dhawan.
The following grammar fails to parse since field
S.b
consumes all available input:This is due to the following code which incorrectly updates the limited view (from
&size
) of the unit with a position pointing after the unit (i.e., parsing theskip
field consumes all available data). https://github.com/zeek/spicy/blob/1825bdbaea723ab184b45687821e9bee137d8d65/spicy/toolchain/src/compiler/codegen/parser-builder.cc#L661-L664This has been broken since at least the introduction of this
skip
syntax in e134dc41e34bf339dd9827ce46cc652865f606bb, i.e., likely since theskip
feature came about.This was originally reported privately by @Mohan-Dhawan.