OSDN Git Service

ucm: add possibility to keep order of childs for If blocks
authorJaroslav Kysela <perex@perex.cz>
Thu, 14 Nov 2019 15:57:22 +0000 (16:57 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 Nov 2019 16:21:20 +0000 (17:21 +0100)
commita0b00a954e12ba9f94f34d80249bcdc222e6d44f
treefa582e935027e68d2ceda30acd0f985248cbe0b0
parent4c021697f11dfcf74c68bbc7aed0f660f3c0dcb3
ucm: add possibility to keep order of childs for If blocks

Because of the nature of the structured parser, it is not guaranteed
that the order of the parsed tree is equal to the lines in the source.

Add possibility to insert the If results before or after the selected
identifier like:

SectionDevice."Speaker" {
  ...
}

If.1 {
Condition { ... }
Before.SectionDevice "Speaker"
True { ... }
}
If.2 {
Condition { ... }
After.SectionDevice "Speaker"
True { ... }
}

If the "After" or "Before" identifiers are not found, the result is added
after the last entry in the block.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/parser.c
src/ucm/ucm_cond.c