diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2017-09-22 07:10:42 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2017-09-22 07:11:56 +0200 |
| commit | 240add8c97403fa77b38a89961becb3476a3c359 (patch) | |
| tree | 6ebdd7d57cb60ff5444f1679ef21bbd9ec91504b | |
| parent | 8f81cbdcc1d35eeb419c96968d4eedbfeee42e55 (diff) | |
Explain the expression structure clearer
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | kconfiglib.py | 6 |
2 files changed, 5 insertions, 4 deletions
@@ -101,7 +101,8 @@ to the test suite would make sense. * **Useful information can be extracted from internal data structures.** The expression format is pretty simple for example: `A && B && (!C || D == 3)` is - represented as (AND A (AND B (OR (NOT C) (EQUAL D 3)))); see the + represented as the tuple structure + `(AND, A, (AND, B, (OR, (NOT, C), (EQUAL, D, 3))))`; see the `Config._parse_expr()` docstring). It's hard to come up with good APIs for dealing with expressions given how diff --git a/kconfiglib.py b/kconfiglib.py index 8ae3360..93b2279 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1102,9 +1102,9 @@ class Config(object): kconfiglib.AND. If there is only one operand (i.e., no && or ||), then the operand is returned directly. This also goes for subexpressions. - As an example, A && B && (!C || D == 3) is represented as - (AND A (AND B (OR (NOT C) (EQUAL D 3)))), with the Symbol objects - stored directly in the expression. + As an example, A && B && (!C || D == 3) is represented as the tuple + structure (AND, A, (AND, B, (OR, (NOT, C), (EQUAL, D, 3)))), with the + Symbol objects stored directly in the expression. feed: _Feed instance containing the tokens for the expression. |
