From 514b9f97febe8920a78d6078b092fe84b859a963 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 7 Dec 2023 23:49:48 +0800 Subject: changed the if-assignment syntax to prevent some errors. --- spec/inputs/cond.yue | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'spec/inputs/cond.yue') diff --git a/spec/inputs/cond.yue b/spec/inputs/cond.yue index 5bc6c9b..cce96df 100644 --- a/spec/inputs/cond.yue +++ b/spec/inputs/cond.yue @@ -52,18 +52,18 @@ elseif "just us" -- -if something = 10 +if something := 10 print something else print "else" -hello = if something = 10 +hello = if something := 10 print something else print "else" -hello = 5 + if something = 10 +hello = 5 + if something := 10 print something --- @@ -72,9 +72,9 @@ z = false _ = if false one -elseif x = true +elseif x := true two -elseif z = true +elseif z := true three else four @@ -82,17 +82,17 @@ else out = if false one -elseif x = true +elseif x := true two -elseif z = true +elseif z := true three else four kzy = -> - if something = true + if something := true 1 - elseif another = false + elseif another := false 2 --- @@ -152,7 +152,7 @@ dddd = {1,2,3} unless value do j = 100 - unless j = hi! + unless j := hi! error "not j!" ---------------- @@ -200,22 +200,22 @@ do elseif c d: e = tb -if :pi = math +if :pi := math print pi do local math - if :pi = math + if :pi := math print pi do - if _M = {} + if _M := {} :Thing = _M :a, :b = _M do global _M - if _M = {} + if _M := {} :Thing = _M :a, :b = _M -- cgit v1.2.3-55-g6feb