From 4146cf9207e2270359dce726aaa8214b2c9cce7a Mon Sep 17 00:00:00 2001 From: AnnieRuru Date: Thu, 14 Jun 2018 01:38:03 +0800 Subject: Fix pre-increment / pre-decrement operator error eg: if (1) ++.@i; --- npc/dev/test.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'npc') 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; -- cgit v1.2.3-60-g2f50