input: vcd: try to continue when a vector was found

No need to bail out on vectors. As long as there are tokens left, we can
try to parse the rest. Also, print a message so the user knows what's
going on. Here is a testcase vcd:

$timescale 1 ns $end
$var wire 1 n0 addr_0 $end
$var wire 1 n1 addr_1 $end
$enddefinitions $end
#0
0n0
b1 n1
#1
1n0
b0 n1
#2
0n0
b1 n1

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
Wolfram Sang 2016-01-09 18:27:14 +01:00 committed by Uwe Hermann
parent 73f052d329
commit 76bc28c3f1
1 changed files with 7 additions and 2 deletions

View File

@ -407,8 +407,13 @@ static void parse_contents(const struct sr_input *in, char *data)
break;
}
} else if (strchr("bBrR", tokens[i][0]) != NULL) {
/* A vector value, not supported yet. */
break;
sr_dbg("Vector values not supported yet");
if (!tokens[++i])
/* No tokens left, bail out */
break;
else
/* Process next token */
continue;
} else if (strchr("01xXzZ", tokens[i][0]) != NULL) {
/* A new 1-bit sample value */
bit = (tokens[i][0] == '1');