aboutsummaryrefslogtreecommitdiff
path: root/doc/testscript.cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-11 14:35:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-11 14:35:00 +0200
commit05b1d9e89a94ee5594168073b8dc363fada987f1 (patch)
tree8ad98d5efa77cc22df0e6752b957e15bc05d6f47 /doc/testscript.cli
parent8ad3ca4563b9a1c3daac37a86173789af03f68ba (diff)
Clean up testscript grammar and parser
Diffstat (limited to 'doc/testscript.cli')
-rw-r--r--doc/testscript.cli55
1 files changed, 30 insertions, 25 deletions
diff --git a/doc/testscript.cli b/doc/testscript.cli
index 123846f..1ba9a4b 100644
--- a/doc/testscript.cli
+++ b/doc/testscript.cli
@@ -708,14 +708,13 @@ script:
scope-body:
*setup
- *(scope|test|include)
- *teardown
+ *(directive|scope|test)
+ *tdown
-setup:
- variable-line|setup-line
+directive:
+ include
-teardown:
- variable-line|teardown-line
+include: '.include' (' '+'--once')*(' '+<path>)*
scope:
?description
@@ -726,54 +725,60 @@ scope-block:
scope-body
'}'
-scope-if: ('if'|'if!') command-expr
+scope-if: ('if'|'if!') command-line
scope-block
*scope-elif
?scope-else
-scope-elif: ('elif'|'elif!') command-expr
+scope-elif: ('elif'|'elif!') command-line
scope-block
scope-else: 'else'
scope-block
-test:
- ?description
- *((variable-line|test-line) ';')
- test-line (':' <text>)?
-
-include: '.include' (' '+'--once')*(' '+<path>)*
-
description:
+(':' <text>)
+setup:
+ variable-line|setup-line
+
+tdown:
+ variable-line|tdown-line
+
+setup-line: '+' command-like
+tdown-line: '-' command-like
+
+test:
+ ?description
+ +(variable-line|command-like)
+
variable-line: <variable> ('='|'+='|'=+') value-attributes? <value>
value-attributes: '[' <key-value-pairs> ']'
-setup-line: '+' command-line
-teardown-line: '-' command-line
-test-line: command-line
+command-like:
+ command-line|command-if
-command-line:
- command-expr|command-if
+# Note: ':' and ';' only valid directly in test.
+#
+command-line: command-expr (';'|(':' <text>))?
+ *here-document
-command-if: ('if'|'if!') command-expr
+command-if: ('if'|'if!') command-line
command-if-body
*command-elif
?command-else
- 'end'
+ 'end' (';'|(':' <text>))?
-command-elif: ('elif'|'elif!') command-expr
+command-elif: ('elif'|'elif!') command-line
command-if-body
command-else: 'else'
command-if-body
command-if-body:
- *(variable-line|command-line)
+ *(variable-line|command-like)
command-expr: command-pipe (('||'|'&&') command-pipe)*
- *here-document
command-pipe: command ('|' command)*