summaryrefslogtreecommitdiff
path: root/npc/dev
diff options
context:
space:
mode:
authorAnnieRuru <jeankof@ymail.com>2018-06-14 01:38:03 +0800
committerAnnieRuru <jeankof@ymail.com>2018-06-14 01:38:03 +0800
commit4146cf9207e2270359dce726aaa8214b2c9cce7a (patch)
tree6cb44dffcc026d372f8dd5597aff858156a8209f /npc/dev
parentfb16806ce0588414c5b808df535b72ef9e7ff6ba (diff)
downloadhercules-4146cf9207e2270359dce726aaa8214b2c9cce7a.tar.gz
hercules-4146cf9207e2270359dce726aaa8214b2c9cce7a.tar.bz2
hercules-4146cf9207e2270359dce726aaa8214b2c9cce7a.tar.xz
hercules-4146cf9207e2270359dce726aaa8214b2c9cce7a.zip
Fix pre-increment / pre-decrement operator error
eg: if (1) ++.@i;
Diffstat (limited to 'npc/dev')
-rw-r--r--npc/dev/test.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt
index a6f89f857..036a94916 100644
--- a/npc/dev/test.txt
+++ b/npc/dev/test.txt
@@ -150,6 +150,20 @@ function script HerculesSelfTestHelper {
callsub(OnCheck, "Prefix decrement --", .@y);
callsub(OnCheck, "Prefix decrement --", .@x);
+ // Increment and decrement operators after a condition
+ .@x = 0;
+ if (1) .@x++;
+ callsub(OnCheck, "Suffix increment ++ after (condition)", .@x);
+ .@x = 2;
+ if (1) .@x--;
+ callsub(OnCheck, "Suffix decrement -- after (condition)", .@x);
+ .@x = 0;
+ if (1) ++.@x;
+ callsub(OnCheck, "Prefix increment ++ after (condition)", .@x);
+ .@x = 2;
+ if (1) --.@x;
+ callsub(OnCheck, "Prefix decrement -- after (condition)", .@x);
+
// Order of [] and --/++
.@a[1] = 0;
.@a[1]++; // .@a[1] = .@a[1] + 1;