From 5381b25c51475c0c7a2f39e9f6efa623f621ef3e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Oct 2016 13:08:31 +0200 Subject: Continue work on testscript parser --- doc/testscript.cli | 66 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'doc/testscript.cli') diff --git a/doc/testscript.cli b/doc/testscript.cli index 1aff571..a5aef9d 100644 --- a/doc/testscript.cli +++ b/doc/testscript.cli @@ -711,23 +711,33 @@ command-exit: ('=='|'!=') command: (' '+ )* {stdin? stdout? stderr?} -stdin: '0'? ('|\ - '<<' ) +stdin: '0'?('|\ + '<<' ) -stdout: '1'? ('>!'|\ - '>' |\ - '>>' ) +stdout: '1'?('>!'|\ + '>' |\ + '>>' ) -stderr: '2' ('>!'|\ - '>' |\ - '>>' ) +stderr: '2'('>!'|\ + '>' |\ + '>>' ) here-document: * \ +Note that if specified, file descriptors must not be separated from the +redirect operator with whitespaces. In other words, the following command +has \c{2} as an argument and redirects \c{stdout}, not \c{stderr}. + +Here-line is like double-quoted string by recognizes newlines. + +\ +$* 2 >! +\ + \ script: (script-scope|script-line)* @@ -782,25 +792,25 @@ command-pipe: command ('|' command)* command: (' '+ )* {stdin? stdout? stderr? cleanup*} -stdin: '0'? ('|\ - '<<' |\ - '<<<' ) - -stdout: '1'? ('>!'|\ - '>?'|\ - '>&' '2'|\ - '>' |\ - '>>' |\ - ('>>>'|'>>>&') ) - -stderr: '2' ('>!'|\ - '>?'|\ - '>&' '1' |\ - '>' |\ - '>>' |\ - ('>>>'|'>>>&') ) +stdin: ('|\ + '<<' |\ + '<<<' ) + +stdout: ('>!'|\ + '>?'|\ + '>&' '2'|\ + '>' |\ + '>>' |\ + ('>>>'|'>>>&') ) + +stderr: '2' ('>!'|\ + '>?'|\ + '>&' '1' |\ + '>' |\ + '>>' |\ + ('>>>'|'>>>&') ) cleanup: '&' (|) -- cgit v1.1