cli: Refactor handling of negative numbers
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 22 Apr 2019 14:41:39 +0000 (10:41 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commitc7a2dd9949cbb056ec0541cd100a59946b71ee0e
tree2b83ea203cbb9d90ee206bc8c21a09d880561afb
parentb4363f9625d018e7944339c3f966a4d96d1184c7
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.026046 seconds and 4 git commands to generate.