Question on disambiguation with undelimited sequences

If this is a language you’re designing, parsing issues like this might be an indication that the syntax is ambiguous and needs more work. If there’s no indication that a with block ends except that subsequent syntax isn’t valid, that’s maybe not ideal?

In any case, yes, you can either use GLR parsing, or structure the grammar in such a way that it only needs to make a different shift or reduce at the point where the ambiguity ends, but in this case, that’d require variable : type and key : value to have the same internal parse structure, which may be weird.