From 54870fb76b5f59cc2e6d69a8c7a8ef17853a0029 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Dec 2016 15:09:04 +0200 Subject: Add comma, ternary, logical operators support in eval context --- doc/manual.cli | 28 ++++++++++++++++++++++------ doc/testscript.cli | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/manual.cli b/doc/manual.cli index de16aae..2d23688 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -15,11 +15,27 @@ \h0#preface|Preface| This is the preface. -" -/* -" -\h Installation +\h1#grammar|Grammar| + +\ +eval: '(' (eval-comma | eval-qual)? ')' +eval-comma: eval-ternary (',' eval-ternary)* +eval-ternary: eval-or ('?' eval-ternary ':' eval-ternary)? +eval-or: eval-and ('||' eval-and)* +eval-and: eval-comp ('&&' eval-comp)* +eval-comp: eval-value (('=='|'!='|'<'|'>'|'<='|'>=') eval-value)* +eval-value: value-attributes? ( | eval | '!' eval-value) +eval-qual: ':' + +value-attributes: '[' ']' +\ + +Note that \c{?:} (ternary operator) and \c{!} (logical not) are +right-associative. Unlike C++, all the comparison operators have the same +precedence. A qualified name cannot be combined with any other operator +(including ternary) unless enclosed in parentheses. The \c{eval} option +in the \c{eval-value} production shall contain single value only (no +commas). + " -source "../INSTALL.cli"; -*/ diff --git a/doc/testscript.cli b/doc/testscript.cli index eaccd0a..1a02c12 100644 --- a/doc/testscript.cli +++ b/doc/testscript.cli @@ -653,7 +653,7 @@ foo? - zero or one multiplier foo bar - concatenation (foo then bar) foo | bar - alternation (foo or bar) (foo bar) - grouping -{foo bar} - concatenation in any order (foo then bar or bar then foo) +{foo bar} - grouping in any order (foo then bar or bar then foo) foo \ bar - line continuation # foo - comment -- cgit v1.1