From dd301fbc0f9f988b47ad7b6532249833b3aa848c Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Mon, 26 Mar 2018 12:53:34 -0400 Subject: [ios, macos] Change the format for case expressions to a flat structure. (#11450) * [ios, macos] Change the format for case expressions to a flat structure. * [ios, macos] Add support for multiple branches case expression. * [ios, macos] Add multiple branch tests to case expressions. * [ios, macos] Case operator now has iOS 8 support. --- platform/darwin/src/NSPredicate+MGLAdditions.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'platform/darwin/src/NSPredicate+MGLAdditions.h') diff --git a/platform/darwin/src/NSPredicate+MGLAdditions.h b/platform/darwin/src/NSPredicate+MGLAdditions.h index 89e9e65c64..cce7561add 100644 --- a/platform/darwin/src/NSPredicate+MGLAdditions.h +++ b/platform/darwin/src/NSPredicate+MGLAdditions.h @@ -16,4 +16,6 @@ @property (nonatomic, readonly) id mgl_jsonExpressionObject; +- (id)mgl_case:(id)firstValue, ...; + @end -- cgit v1.2.1 From 9a663fb4799bedb85ca583d7f23a1a67277d220b Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Mon, 26 Mar 2018 15:22:54 -0400 Subject: [ios, macos] Add match expressions support. (#11464) * [ios, macos] Add match expressions support. * [ios, macos] Add coalesce operator support. * [ios, macos] Add coalesce operator test. * [ios, macos] Match operator implementation is moved to NSPredicate. * [ios, macos] Match operator function implementation refactor. * [ios, macos] Address merge conflicts. --- platform/darwin/src/NSPredicate+MGLAdditions.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'platform/darwin/src/NSPredicate+MGLAdditions.h') diff --git a/platform/darwin/src/NSPredicate+MGLAdditions.h b/platform/darwin/src/NSPredicate+MGLAdditions.h index cce7561add..a67c6ca005 100644 --- a/platform/darwin/src/NSPredicate+MGLAdditions.h +++ b/platform/darwin/src/NSPredicate+MGLAdditions.h @@ -18,4 +18,6 @@ - (id)mgl_case:(id)firstValue, ...; +- (id)mgl_match:(NSExpression *)firstCase, ...; + @end -- cgit v1.2.1 From 8c5eb6ca9cbb26778c7ad2ce58c2d673d6170300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 29 Mar 2018 10:25:05 -0700 Subject: Install aftermarket expression functions (#11472) * [ios, macos] Introduced more ergonomic expression concatenation syntax * [ios, macos] Fixed mgl_join: * [ios, macos] Simplified expression document headings * [ios, macos] Documented mgl_join: * [ios, macos] Convert length operator to length: for strings Only works for literal strings. * [ios, macos] Implemented type conversion using CAST() * [ios, macos] Aftermarket let expressions * [ios, macos] Refactored aftermarket expression functions Refactored the installation of aftermarket expression functions to use macros. It is no longer necessary to handwrite the type encoding of a function. Also added aftermarket functions for interpolating and stepping. * [ios, macos] Updated documentation, tests, demo apps * [ios, macos] Added generic expression function * [ios, macos] Add MGL_MATCH function placeholder. * [ios, macos] Add MGL_SWITCH expression operator. * [ios, macos] Add mgl_coalesce: as expression function. * [ios, macos] Update style documentation. * [ios, macos] Add conventional custom function support. * [ios, macos] Updated example code * [ios, macos] Add mgl_coalesce conventional custom function support. * [ios, macos] Add aftermarket function to 'has' operator. * [ios, macos] Add documentation for lookup and feature operators. * [ios, macos] Documented simple lookup * [ios, macos] Renamed, reversed has expression Renamed mgl_hasProperty:properties: to mgl_does:have: for better readability and consistency with the conventional mgl_has: function. Documented both forms of mgl_has:. * [ios, macos] Restored OEM conditionals where available This is the preferred syntax for simple conditionals on iOS 9 and above, because you can inline the predicate instead of wrapping it in a constant value expression, which means you can write a conditional in a single format string. * [ios, macos] Update style docs. Co-authored-by: Fabian Guerra --- platform/darwin/src/NSPredicate+MGLAdditions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/darwin/src/NSPredicate+MGLAdditions.h') diff --git a/platform/darwin/src/NSPredicate+MGLAdditions.h b/platform/darwin/src/NSPredicate+MGLAdditions.h index a67c6ca005..a73b1a61ba 100644 --- a/platform/darwin/src/NSPredicate+MGLAdditions.h +++ b/platform/darwin/src/NSPredicate+MGLAdditions.h @@ -16,7 +16,7 @@ @property (nonatomic, readonly) id mgl_jsonExpressionObject; -- (id)mgl_case:(id)firstValue, ...; +- (id)mgl_if:(id)firstValue, ...; - (id)mgl_match:(NSExpression *)firstCase, ...; -- cgit v1.2.1