From 240add8c97403fa77b38a89961becb3476a3c359 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 22 Sep 2017 07:10:42 +0200 Subject: Explain the expression structure clearer --- README.md | 3 ++- kconfiglib.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 272420f..bbf3ec5 100644 --- a/README.md +++ b/README.md @@ -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. -- cgit v1.2.3