diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-04-09 09:44:16 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-04-09 09:44:16 +0200 |
commit | a2d3dff6909eb1a0a7f4639b6f8d09e19342c4bf (patch) | |
tree | 843e4e037bf27943ba8e480109369cd57230e886 /tests | |
parent | 4d0ee66f29cf487cc848a3f4f0f672e2cb0aa3c7 (diff) | |
parent | 5bbebe4a8913b3f304701aa3b4eaf082bd4fe8ca (diff) | |
download | Nim-a2d3dff6909eb1a0a7f4639b6f8d09e19342c4bf.tar.gz |
Merge pull request #2491 from ReneSac/strongSpacesFix
Apply strongSpaces to keyword operators too. Fix #1894.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/parser/tstrongspaces.nim | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/parser/tstrongspaces.nim b/tests/parser/tstrongspaces.nim index 91506daf0..568abda4c 100644 --- a/tests/parser/tstrongspaces.nim +++ b/tests/parser/tstrongspaces.nim @@ -2,6 +2,12 @@ discard """ output: '''35 +true +true +4 +true +1 +false 77 (Field0: 1, Field1: 2, Field2: 2) ha @@ -14,6 +20,17 @@ all args echo 2+5 * 5 +# Keyword operators +echo 1 + 16 shl 1 == 1 + (16 shl 1) +echo 2 and 1 in {0, 30} +echo 2+2 * 2 shr 1 +echo false or 2 and 1 in {0, 30} + +proc `^`(a, b: int): int = a + b div 2 +echo 19 mod 16 ^ 4 + 2 and 1 +echo 18 mod 16 ^ 4 > 0 + +# echo $foo gotcha let foo = 77 echo $foo @@ -27,7 +44,7 @@ when true: let b = 66 let c = 90 let bar = 8000 - if foo+4 * 4 == 8 and b&c | 9 ++ + if foo+4 * 4 == 8 and b&c | 9 ++ bar: echo "ho" else: |