From aed806476fe50899c0f01750175531ac41267b9d Mon Sep 17 00:00:00 2001 From: Li Jin Date: Sun, 31 Oct 2021 17:29:45 +0800 Subject: partially fix issue #69, fix a few case the generated code leaks some temp variables. --- spec/inputs/nil_coalesing.yue | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 spec/inputs/nil_coalesing.yue (limited to 'spec/inputs') diff --git a/spec/inputs/nil_coalesing.yue b/spec/inputs/nil_coalesing.yue new file mode 100644 index 0000000..45b34f4 --- /dev/null +++ b/spec/inputs/nil_coalesing.yue @@ -0,0 +1,40 @@ +do + a = b ?? c + +do + :a = b ?? c + +do + a = func! + a ??= false + +do + a ??= func! + +do + local a, b, c, d, e + a = b ?? c ?? d ?? e + +do + a = b ?? c ?? d ?? e + +do + func x ?? "hello" + +do + with funcA! ?? funcB! + print .field + +do + a = 1 + 2 + b ?? c + 3 + 4 + +do + a = 1 + 2 + (b ?? c) + 3 + 4 + +do + :a, :b = func! + a or= 1 + b ??= c ?? 2 + +nil + -- cgit v1.2.3-55-g6feb