Commit f199991
committed
WIP: config/schema: collect annotations in :pairs()
Sometimes we need to know somethings about parent nodes during
processing of a current node.
The ideal solution would be pre-process schema in `schema.new()` and
saturate schema nodes with extra information. For example, we can add a
`parent` field. Or merge annotations from the root node down to the
current one and store in the current node.
However, we have shared schema nodes between instance_config and
cluster_config. I'm in a doubt whether the copying in appropriate places
would be error-prone.
The next commit needs the annotations from the parent nodes in
`<schema>:pairs()`, so this functionality is added to this particular
method.
TBD: Consider the alternative approach with precomputing on
`schema.new()` and a copying function for a schema.
TBD: Add a test.
TBD: Part of #xxxx
NO_DOC=the schema module is internal, at least now
NO_CHANGELOG=see NO_DOC1 parent 59f7371 commit f199991
1 file changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
105 | 130 | | |
106 | 131 | | |
107 | 132 | | |
| |||
1345 | 1370 | | |
1346 | 1371 | | |
1347 | 1372 | | |
| 1373 | + | |
1348 | 1374 | | |
1349 | 1375 | | |
1350 | 1376 | | |
| 1377 | + | |
1351 | 1378 | | |
| 1379 | + | |
1352 | 1380 | | |
1353 | 1381 | | |
1354 | 1382 | | |
| 1383 | + | |
| 1384 | + | |
1355 | 1385 | | |
1356 | 1386 | | |
1357 | 1387 | | |
| |||
1367 | 1397 | | |
1368 | 1398 | | |
1369 | 1399 | | |
| 1400 | + | |
| 1401 | + | |
1370 | 1402 | | |
1371 | 1403 | | |
1372 | 1404 | | |
| |||
1377 | 1409 | | |
1378 | 1410 | | |
1379 | 1411 | | |
| 1412 | + | |
1380 | 1413 | | |
1381 | 1414 | | |
1382 | 1415 | | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
1383 | 1421 | | |
1384 | 1422 | | |
1385 | | - | |
| 1423 | + | |
1386 | 1424 | | |
1387 | 1425 | | |
1388 | 1426 | | |
| |||
0 commit comments