From 7ac3519dc40bb6f6ab979c9cd35fd585f25d1c25 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 23 Jan 2020 14:35:14 +0800 Subject: fix Moonscript issue 156, update new 'import' functions. --- spec/inputs/comprehension.moon | 2 +- spec/inputs/destructure.moon | 7 ++++++- spec/inputs/existential.moon | 16 ++++++++++++++-- spec/inputs/import.moon | 19 +++++++++++++++++++ 4 files changed, 40 insertions(+), 4 deletions(-) (limited to 'spec/inputs') diff --git a/spec/inputs/comprehension.moon b/spec/inputs/comprehension.moon index f07cf89..b6adb94 100644 --- a/spec/inputs/comprehension.moon +++ b/spec/inputs/comprehension.moon @@ -47,6 +47,6 @@ ok(a,b,c) for {a,b,c} in things _ = [item for item in *items[1 + 2,3+4]] _ = [item for item in *items[hello! * 4, 2 - thing[4]]] - +list = [item?\invoke 123 for item in items] nil diff --git a/spec/inputs/destructure.moon b/spec/inputs/destructure.moon index 2509968..5bc7810 100644 --- a/spec/inputs/destructure.moon +++ b/spec/inputs/destructure.moon @@ -95,6 +95,11 @@ _ = (z) -> do z = "oo" - (k) -> + _ = (k) -> {a,b,c} = z +do + {function:{end:endVar}} = thing + +do + {if:{a,b,c}} = thing diff --git a/spec/inputs/existential.moon b/spec/inputs/existential.moon index 97e8de0..eaa3266 100644 --- a/spec/inputs/existential.moon +++ b/spec/inputs/existential.moon @@ -1,8 +1,20 @@ -if {:x} = a?.if?\then?(123)? @?\function 998 + +f?! + +x = tab?.value + +print abc?["hello world"]?.xyz + +if print and x? print x +@?\func 998 + with abc?!\func?! if \p? "abc" return 123 -@?\func 998 +if {:x} = a?.if?\then?(123)? @?\function 998 + print x + + diff --git a/spec/inputs/import.moon b/spec/inputs/import.moon index d86d724..ef6f4ee 100644 --- a/spec/inputs/import.moon +++ b/spec/inputs/import.moon @@ -46,3 +46,22 @@ do c from z + +do + import 'module' + import 'module_x' + import "d-a-s-h-e-s" + import "module.part" + +do + import "player" as Player + import "lpeg" as {:C, :Ct, :Cmt} + +do + export * + import 'module' + import 'module_x' + import "org.package.module-y" + +do + import "org.package.module" as {function:func,if:ifVar} -- cgit v1.2.3-55-g6feb