Commit Graph

4 Commits

Author SHA1 Message Date
Petr Špaček
ca866c7e92 Sort grammar map keys while pretty printing them
It would be too easy if we could just call sorted(). Thanks to zone
grammar the most important key "type" gets sorted near end, so we pull
it up to the top using a hack.

(cherry picked from commit 5c04e3c524)
2022-07-01 10:21:05 +02:00
Petr Špaček
9b2bf0f8be Pretty-print grammar for zones
It turns out the tree of dictionaries is not the best structure to
represent our grammar, unfortunatelly. The problem is that "zone" has
several context-dependent variants which change meaning of "zone" based
on inner field "type".

Redesigning the whole structure does not seem to be worth, so I settled
on this terrible hack.

(cherry picked from commit 0392144e99)
2022-07-01 10:21:05 +02:00
Petr Špaček
ec9af7dbc7 Add pretty printer for JSON grammar
It produces the same format as cfg_test --grammar. The advantage is that
it allows to print any node in configuration the tree, not just whole
blocks.

(cherry picked from commit 190004e46c)
2022-07-01 10:00:27 +02:00
Petr Špaček
aabdff9551 Add utility to search for context-dependent configuration statements
The utility detects statements which use the same name (e.g.
max-zone-ttl) but use different grammar in different contexts. These
typically need special case in docs.

(cherry picked from commit 8960d51aa3)
2022-07-01 10:00:27 +02:00