cli: Refactor handling of negative numbers
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 22 Apr 2019 14:41:39 +0000 (10:41 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:39 +0000 (18:19 -0400)
commit663d08793c88d24492e95cb0cc205130c80020b5
treeb348959b72a2a7f800f80a39a8c3c45581279bb4
parentc59726bfb43b6c53755e20d4190f1dd21827269c
cli: Refactor handling of negative numbers

This patch breaks out the code that reads a number just after having
read the minus sign introducing a negative number.

Instead of keeping a state in the parser, and going through a new
iteration, we call the new function which returns a bt_value directly.

This enables the following patch to do a similar change, but for the
parsing of all values (which includes the parsing of negative numbers).
In turn, this will allow parsing values recursively, which is needed to
support array values.  Orthogonally, I think the code is easier to
follow this way.

No functional changes intended.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
cli/babeltrace-cfg-cli-args.c
This page took 0.024604 seconds and 4 git commands to generate.