From 90cd12ad9ef465f3e435e1bd034dcfbe4e19d016 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Mon, 15 Feb 2021 21:16:45 +0800 Subject: adding more test cases. --- spec/inputs/multiline_chain.mp | 67 ++++++++++++++++++++++++++++++++++++++++++ spec/inputs/syntax.mp | 15 ---------- 2 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 spec/inputs/multiline_chain.mp (limited to 'spec') diff --git a/spec/inputs/multiline_chain.mp b/spec/inputs/multiline_chain.mp new file mode 100644 index 0000000..e1e363f --- /dev/null +++ b/spec/inputs/multiline_chain.mp @@ -0,0 +1,67 @@ +x = a + .b + +x + .y = a + \b! + +func 1, arg2 + .value + \get!, arg3 + .value + \get! + +result = origin + .transform.root + .gameObject + \Parents! + \Descendants! + \SelectEnable! + \SelectVisible! + \TagEqual "fx" + \Where (x)-> + if x\IsTargeted! + return false + x.name\EndsWith "(Clone)" + \Destroy! + +origin.transform.root.gameObject + \Parents!\Descendants! + \SelectEnable! + \SelectVisible! + \TagEqual "fx" + \Where (x)-> x.name\EndsWith "(Clone)" + \Destroy! + +with item() + .itemFieldA = 123 + item = x + + \callMethod!\chainCall! + + \callMethod! + \chainCall! + \chainCall! + + switch .itemFieldB + \getValue! + when "Valid", \getItemState! + \itemMethodA!\getValue! + else + \itemMethodB! + \getValue! + + a = if .itemFieldC + .itemFieldD + else + .itemFieldE + + for v in *values + \itemMethodC v + + unless .b + .c = while .itemFieldD + \itemNext! + \get! + +nil diff --git a/spec/inputs/syntax.mp b/spec/inputs/syntax.mp index f3a0a5c..4df5785 100644 --- a/spec/inputs/syntax.mp +++ b/spec/inputs/syntax.mp @@ -123,21 +123,6 @@ argon\world().something() argon\somethin"200".world(1,2) -origin - .transform - .root - .gameObject - \Parents! - \Descendants! - \SelectEnable! - \SelectVisible! - \TagEqual "fx" - \Where (x) -> - if x\IsTargeted! - return false - x.name\EndsWith "(Clone)" - \Destroy! - x = -434 x = -hello world one two -- cgit v1.2.3-55-g6feb