docs(expression.py): describe new `name` & `value` productions

This commit is contained in:
lovetheguitar 2024-06-22 19:57:05 +02:00
parent 3cce243774
commit 540ede3439
1 changed files with 3 additions and 0 deletions

View File

@ -8,12 +8,15 @@ and_expr: not_expr ('and' not_expr)*
not_expr: 'not' not_expr | '(' expr ')' | ident ('(' name '=' value ( ', ' name '=' value )* ')')?
ident: (\w|:|\+|-|\.|\[|\]|\\|/)+
name: a valid ident, but not a reserved keyword
value: (unescaped) string literal | (-)?[0-9]+ | 'False' | 'True' | 'None'
The semantics are:
- Empty expression evaluates to False.
- ident evaluates to True or False according to a provided matcher function.
- or/and/not evaluate according to the usual boolean semantics.
- ident with parentheses and keyword arguments evaluates to True or False according to a provided matcher function.
"""
from __future__ import annotations