From 1cb79a7245a86f563a8e54a0b47937f253636bde Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 24 Feb 2010 17:12:09 -0800 Subject: Permit chained unary operators The operand of a unary may be yet another unary. This is useful for things like boolean normalization, !!x. * parse.cxx (parser::parse_unary): Recurse the operand. * testsuite/parseok/eleven.stp: Add chained unary operators. --- testsuite/parseok/eleven.stp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/parseok/eleven.stp b/testsuite/parseok/eleven.stp index 737a2e14..5ee0f921 100755 --- a/testsuite/parseok/eleven.stp +++ b/testsuite/parseok/eleven.stp @@ -53,5 +53,11 @@ probe two - a # grammar glitch - a % b ; -- a ; ++ a ; a ++ ; a -- + a % b ; -- a ; ++ a ; a ++ ; a -- ; + + # chained unary operators + + + a ; + - a ; + ! a ; + ~ a ; + - + a ; - - a ; - ! a ; - ~ a ; + ! + a ; ! - a ; ! ! a ; ! ~ a ; + ~ + a ; ~ - a ; ~ ! a ; ~ ~ a ; } -- cgit