doc: genrest: Simplify select logic with split_expr()
doc: genrest: Simplify select logic with split_expr()

The logic for walking reverse dependencies (from 'select's and 'imply's)
is a bit tricky to read (and write), and was essentially duplicated in a
few different spots (including in the upcoming menuconfig
implementation).

Use a new split_expr() helper function that's been added to Kconfiglib
to reduce code duplication and make the code more readable.

This also has another nice side effect: The list of symbols that select
a particular symbol now has the symbols in the order that they appear in
the Kconfig files.

Signed-off-by: Ulf Magnusson <f650684f780c6b48c0158c4e0f2e27f74aabc755@gmail.com>

zephyrproject-rtos/zephyr,punitvara/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,kraj/zephyr,finikorg/zephyr,finikorg/zephyr,finikorg/zephyr,explora26/zephyr,finikorg/zephyr,mbolivar/zephyr,zephyriot/zephyr,explora26/zephyr,Vudentz/zephyr,galak/zephyr,ldts/zephyr,punitvara/zephyr,galak/zephyr,kraj/zephyr,GiulianoFranchetto/zephyr,zephyriot/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,kraj/zephyr,mbolivar/zephyr,punitvara/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,mbolivar/zephyr,explora26/zephyr,ldts/zephyr,kraj/zephyr,zephyriot/zephyr,ldts/zephyr,zephyriot/zephyr,explora26/zephyr,Vudentz/zephyr,nashif/zephyr,ldts/zephyr,mbolivar/zephyr,nashif/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,mbolivar/zephyr,nashif/zephyr,galak/zephyr,Vudentz/zephyr,zephyriot/zephyr,galak/zephyr,finikorg/zephyr,kraj/zephyr,nashif/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr