changeset 28:bc3437ecb12b

Add a test for unaryop and fix ast_dump for unaryop::Not.
author Bastien Orivel <eijebong@bananium.fr>
date Fri, 03 Jun 2016 23:59:41 +0200
parents 4c926e910b80
children a545f7bbccc1
files src/ast_dump.rs tests/test_parse_files/test_unaryop.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ast_dump.rs
+++ b/src/ast_dump.rs
@@ -35,7 +35,7 @@ impl unaryop {
     fn to_string(&self) -> &'static str {
         match *self {
             unaryop::Invert => "~",
-            unaryop::Not => "!",
+            unaryop::Not => "not ",
             unaryop::UAdd => "+",
             unaryop::USub => "-"
         }
new file mode 100644
--- /dev/null
+++ b/tests/test_parse_files/test_unaryop.py
@@ -0,0 +1,4 @@
+a = ~5
+a = -5
+a = not False
+a = +5