This repository was archived by the owner on May 16, 2025. It is now read-only.

Description
The parser is handling multi-line comments inside hex strings incorrectly. Let's use the following rule as an example:
rule TEST {
strings:
$ = {
01 [5] /* comment 1 */
02 /* comment 2 */
}
condition:
all of them
}
The rule is correct, but the parser is returning the following error:
unexpected RBRACE, expecting BYTE or MASKED_BYTE or LBRACKET or LPARENS
This is because the once the parser finds the opening /* for the first comment, it greedily consumes all the characters until the closing */ in the second comment. This causes the 02 byte to fall inside the comment, so the parser is actually seeing the string as: { 01 [5] }, which is syntactically invalid.