Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Update 3rd party library GRMustache to v7.0.2"

This reverts commit 783363c.

Conflicts:
	Main Project (Textual).xcodeproj/project.pbxproj
  • Loading branch information...
commit 1a34086f4f5912f8c5fb121815527ca30e9224e5 1 parent cfd8275
@emsquared emsquared authored
Showing with 1,232 additions and 848 deletions.
  1. +44 −54 Classes/Headers/External Libraries/GRMustache.h
  2. +784 −16 Classes/Headers/External Libraries/GRMustacheAvailabilityMacros.h
  3. +73 −67 Classes/Headers/External Libraries/GRMustacheConfiguration.h
  4. +0 −54 Classes/Headers/External Libraries/GRMustacheContentType.h
  5. +118 −195 Classes/Headers/External Libraries/GRMustacheContext.h
  6. +7 −8 Classes/Headers/External Libraries/GRMustacheError.h
  7. +4 −10 Classes/Headers/External Libraries/GRMustacheFilter.h
  8. +7 −8 Classes/Headers/External Libraries/GRMustacheLocalizer.h
  9. +2 −65 Classes/Headers/External Libraries/GRMustacheRendering.h
  10. +0 −55 Classes/Headers/External Libraries/GRMustacheSafeKeyAccess.h
  11. +30 −21 Classes/Headers/External Libraries/GRMustacheTag.h
  12. +6 −5 Classes/Headers/External Libraries/GRMustacheTagDelegate.h
  13. +36 −91 Classes/Headers/External Libraries/GRMustacheTemplate.h
  14. +117 −181 Classes/Headers/External Libraries/GRMustacheTemplateRepository.h
  15. +4 −4 Classes/Headers/External Libraries/GRMustacheVersion.h
  16. +0 −2  Classes/Headers/TextualApplication.h
  17. BIN  Frameworks/Mustache Templates/libmustache.a
  18. +0 −12 Main Project (Textual).xcodeproj/project.pbxproj
View
98 Classes/Headers/External Libraries/GRMustache.h
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2014 Gwendal Roué
+// Copyright (c) 2013 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -21,7 +21,6 @@
// THE SOFTWARE.
#import <Foundation/Foundation.h>
-
#import "GRMustacheAvailabilityMacros.h"
@protocol GRMustacheRendering;
@@ -55,9 +54,9 @@ typedef struct {
/**
* @return The version of GRMustache as a GRMustacheVersion struct.
*
- * @since v7.0
+ * @since v1.0
*/
-+ (GRMustacheVersion)libraryVersion AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (GRMustacheVersion)version AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
////////////////////////////////////////////////////////////////////////////////
@@ -68,52 +67,31 @@ typedef struct {
* Have GRMustache avoid most `NSUndefinedKeyExceptions` when rendering
* templates.
*
- * The rendering of a GRMustache template can lead to `NSUndefinedKeyExceptions`
- * to be raised, because of the usage of the `valueForKey:` method. Those
- * exceptions are nicely handled by GRMustache, and are part of the regular
- * rendering of a template.
- *
- * Unfortunately, Objective-C exceptions have several drawbacks, particularly:
- *
- * 1. they play badly with autorelease pools, and are reputed to leak memory.
- * 2. they usually stop your debugger when you are developping your application.
+ * The rendering of a GRMustache template can lead to many
+ * `NSUndefinedKeyExceptions` to be raised, because of the heavy usage of
+ * Key-Value Coding. Those exceptions are nicely handled by GRMustache, and are
+ * part of the regular rendering of a template.
*
- * The first point is indeed a matter of worry: Apple does not guarantee that
- * exceptions raised by `valueForKey:` do not leak memory. However, I never had
- * any evidence of such a leak from NSObject's implementation.
+ * Unfortunately, when debugging a project, developers usually set their
+ * debugger to stop on every Objective-C exceptions. GRMustache rendering can
+ * thus become a huge annoyance. This method prevents it.
*
- * Should you still worry, we recommend that you avoid the `valueForKey:` method
- * altogether. Instead, implement the [keyed subscripting](http://clang.llvm.org/docs/ObjectiveCLiterals.html#dictionary-style-subscripting)
- * `objectForKeyedSubscript:` method on objects that you provide to GRMustache.
+ * You'll get a slight performance hit, so you'd probably make sure this call
+ * does not enter your Release configuration.
*
- * The second point is valid also: NSUndefinedKeyException raised by template
- * rendering may become a real annoyance when you are debugging your project,
- * because it's likely you've told your debugger to stop on every Objective-C
- * exceptions.
+ * One way to achieve this is to add `-DDEBUG` to the "Other C Flags" setting of
+ * your development configuration, and to wrap the
+ * `preventNSUndefinedKeyExceptionAttack` method call in a #if block, like:
*
- * You can avoid them as well: make sure you invoke once, early in your
- * application, the `preventNSUndefinedKeyExceptionAttack` method.
+ * #ifdef DEBUG
+ * [GRMustache preventNSUndefinedKeyExceptionAttack];
+ * #endif
*
- * Depending on the number of NSUndefinedKeyException that get prevented, you
- * will experience a slight performance hit, or a performance improvement.
- *
- * Since the main use case for this method is to avoid Xcode breaks on rendering
- * exceptions, the best practice is to conditionally invoke this method, using
- * the [NS_BLOCK_ASSERTIONS](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html)
- * that helps identifying the Debug configuration of your targets:
- *
- * ```
- * #if !defined(NS_BLOCK_ASSERTIONS)
- * // Debug configuration: keep GRMustache quiet
- * [GRMustache preventNSUndefinedKeyExceptionAttack];
- * #endif
- * ```
- *
* **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/runtime.md
*
* @since v1.7
*/
-+ (void)preventNSUndefinedKeyExceptionAttack AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (void)preventNSUndefinedKeyExceptionAttack AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
////////////////////////////////////////////////////////////////////////////////
@@ -127,7 +105,7 @@ typedef struct {
*
* @since v6.4
*/
-+ (NSObject *)standardLibrary AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (NSObject *)standardLibrary AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
////////////////////////////////////////////////////////////////////////////////
@@ -135,26 +113,40 @@ typedef struct {
////////////////////////////////////////////////////////////////////////////////
/**
- * This method is deprecated. Use
- * `+[GRMustacheRendering renderingObjectForObject:]` instead.
+ * Returns a rendering object that is able to render the argument _object_ for
+ * the various Mustache tags.
*
- * @see GRMustacheRendering class
+ * If _object_ already conforms to the GRMustacheRendering protocol, this method
+ * returns _object_ itself: it is already able to render.
+ *
+ * For other values, including `nil`, this method returns a rendering object
+ * that provides the default GRMustache rendering.
+ *
+ * @param object An object.
+ *
+ * @return A rendering object able to render the argument.
+ *
+ * @see GRMustacheRendering protocol
*
* @since v6.0
- * @deprecated v7.0
*/
-+ (id<GRMustacheRendering>)renderingObjectForObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER_BUT_DEPRECATED;
++ (id<GRMustacheRendering>)renderingObjectForObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
- * This method is deprecated. Use
- * `+[GRMustacheRendering renderingObjectWithBlock:]` instead.
+ * Returns a rendering object that renders with the provided block.
+ *
+ * @param block A block that follows the semantics of the
+ * renderForMustacheTag:context:HTMLSafe:error: method defined by
+ * the GRMustacheRendering protocol. See the documentation of this
+ * method.
+ *
+ * @return A rendering object
*
- * @see GRMustacheRendering class
+ * @see GRMustacheRendering protocol
*
* @since v6.0
- * @deprecated v7.0
*/
-+ (id<GRMustacheRendering>)renderingObjectWithBlock:(NSString *(^)(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error))block AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER_BUT_DEPRECATED;
++ (id<GRMustacheRendering>)renderingObjectWithBlock:(NSString *(^)(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error))block AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
@end
@@ -164,10 +156,8 @@ typedef struct {
#import "GRMustacheFilter.h"
#import "GRMustacheError.h"
#import "GRMustacheVersion.h"
-#import "GRMustacheContentType.h"
#import "GRMustacheContext.h"
#import "GRMustacheRendering.h"
#import "GRMustacheTag.h"
#import "GRMustacheConfiguration.h"
#import "GRMustacheLocalizer.h"
-#import "GRMustacheSafeKeyAccess.h"
View
800 Classes/Headers/External Libraries/GRMustacheAvailabilityMacros.h
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2014 Gwendal Roué
+// Copyright (c) 2013 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -28,7 +28,15 @@
/*
* Set up standard GRMustache versions
*/
-#define GRMUSTACHE_VERSION_7_0 7000
+#define GRMUSTACHE_VERSION_6_0 6000
+#define GRMUSTACHE_VERSION_6_1 6010
+#define GRMUSTACHE_VERSION_6_2 6020
+#define GRMUSTACHE_VERSION_6_3 6030
+#define GRMUSTACHE_VERSION_6_4 6040
+#define GRMUSTACHE_VERSION_6_5 6050
+#define GRMUSTACHE_VERSION_6_6 6060
+#define GRMUSTACHE_VERSION_6_7 6070
+#define GRMUSTACHE_VERSION_6_8 6080
@@ -36,10 +44,10 @@
/*
- * If max GRMustacheVersion not specified, assume 7.0
+ * If max GRMustacheVersion not specified, assume 6.8
*/
#ifndef GRMUSTACHE_VERSION_MAX_ALLOWED
-#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_7_0
+#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_6_8
#endif
/*
@@ -55,8 +63,8 @@
#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_MIN_REQUIRED
#error GRMUSTACHE_VERSION_MAX_ALLOWED must be >= GRMUSTACHE_VERSION_MIN_REQUIRED
#endif
-#if GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_7_0
-#error GRMUSTACHE_VERSION_MIN_REQUIRED must be >= GRMUSTACHE_VERSION_7_0
+#if GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_0
+#error GRMUSTACHE_VERSION_MIN_REQUIRED must be >= GRMUSTACHE_VERSION_6_0
#endif
@@ -65,26 +73,786 @@
/*
- * AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
*
- * Used on declarations introduced in GRMustache 7.0
+ * Used on declarations introduced in GRMustache 6.0
*/
-#define AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
/*
- * AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER_BUT_DEPRECATED
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED
*
- * Used on declarations introduced in GRMustache 7.0,
- * and deprecated in GRMustache 7.0
+ * Used on declarations introduced in GRMustache 6.0,
+ * and deprecated in GRMustache 6.0
*/
-#define AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
/*
- * DEPRECATED_IN_GRMUSTACHE_VERSION_7_0_AND_LATER
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_0_AND_LATER
*
- * Used on types deprecated in GRMustache 7.0
+ * Used on types deprecated in GRMustache 6.0
*/
-#define DEPRECATED_IN_GRMUSTACHE_VERSION_7_0_AND_LATER DEPRECATED_ATTRIBUTE
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_0_AND_LATER DEPRECATED_ATTRIBUTE
+
+
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 6.1
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_1
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_1
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 6.1,
+ * and deprecated in GRMustache 6.1
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_1
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_1
+ *
+ * Used on declarations introduced in GRMustache 6.0,
+ * but later deprecated in GRMustache 6.1
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_1
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_1 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_1 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_1_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 6.1
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_1
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_1_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 6.2
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_2
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_2
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 6.2,
+ * and deprecated in GRMustache 6.2
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_2
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2
+ *
+ * Used on declarations introduced in GRMustache 6.0,
+ * but later deprecated in GRMustache 6.2
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_2
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2
+ *
+ * Used on declarations introduced in GRMustache 6.1,
+ * but later deprecated in GRMustache 6.2
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_2
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2 AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_2_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 6.2
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_2
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_2_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 6.3
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_3
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_3
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 6.3,
+ * and deprecated in GRMustache 6.3
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3
+ *
+ * Used on declarations introduced in GRMustache 6.0,
+ * but later deprecated in GRMustache 6.3
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3
+ *
+ * Used on declarations introduced in GRMustache 6.1,
+ * but later deprecated in GRMustache 6.3
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3 AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3
+ *
+ * Used on declarations introduced in GRMustache 6.2,
+ * but later deprecated in GRMustache 6.3
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3 AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_3_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 6.3
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_3_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_3_AND_LATER
+#endif
+
+
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 6.4
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_4
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_4
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 6.4,
+ * and deprecated in GRMustache 6.4
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4
+ *
+ * Used on declarations introduced in GRMustache 6.0,
+ * but later deprecated in GRMustache 6.4
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4
+ *
+ * Used on declarations introduced in GRMustache 6.1,
+ * but later deprecated in GRMustache 6.4
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4 AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4
+ *
+ * Used on declarations introduced in GRMustache 6.2,
+ * but later deprecated in GRMustache 6.4
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4 AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4
+ *
+ * Used on declarations introduced in GRMustache 6.3,
+ * but later deprecated in GRMustache 6.4
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4 AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_4_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 6.4
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_4_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_4_AND_LATER
+#endif
+
+
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 6.5
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_5
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_5
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 6.5,
+ * and deprecated in GRMustache 6.5
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_5
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5
+ *
+ * Used on declarations introduced in GRMustache 6.0,
+ * but later deprecated in GRMustache 6.5
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_5
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5
+ *
+ * Used on declarations introduced in GRMustache 6.1,
+ * but later deprecated in GRMustache 6.5
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_5
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5
+ *
+ * Used on declarations introduced in GRMustache 6.2,
+ * but later deprecated in GRMustache 6.5
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_5
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5
+ *
+ * Used on declarations introduced in GRMustache 6.3,
+ * but later deprecated in GRMustache 6.5
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_5
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5
+ *
+ * Used on declarations introduced in GRMustache 6.4,
+ * but later deprecated in GRMustache 6.5
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_5
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_5 AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_5_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 6.5
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_5
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_5_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_5_AND_LATER
+#endif
+
+
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 6.6,
+ * and deprecated in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6
+ *
+ * Used on declarations introduced in GRMustache 6.0,
+ * but later deprecated in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6
+ *
+ * Used on declarations introduced in GRMustache 6.1,
+ * but later deprecated in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6
+ *
+ * Used on declarations introduced in GRMustache 6.2,
+ * but later deprecated in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6
+ *
+ * Used on declarations introduced in GRMustache 6.3,
+ * but later deprecated in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6
+ *
+ * Used on declarations introduced in GRMustache 6.4,
+ * but later deprecated in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6
+ *
+ * Used on declarations introduced in GRMustache 6.5,
+ * but later deprecated in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_6
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_6 AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_6_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 6.6
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_6
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_6_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_6_AND_LATER
+#endif
+
+
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 6.7,
+ * and deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7
+ *
+ * Used on declarations introduced in GRMustache 6.0,
+ * but later deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7
+ *
+ * Used on declarations introduced in GRMustache 6.1,
+ * but later deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7
+ *
+ * Used on declarations introduced in GRMustache 6.2,
+ * but later deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7
+ *
+ * Used on declarations introduced in GRMustache 6.3,
+ * but later deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7
+ *
+ * Used on declarations introduced in GRMustache 6.4,
+ * but later deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7
+ *
+ * Used on declarations introduced in GRMustache 6.5,
+ * but later deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7
+ *
+ * Used on declarations introduced in GRMustache 6.6,
+ * but later deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_7 AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_7_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 6.7
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_7
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_7_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_7_AND_LATER
+#endif
+
+
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 6.8,
+ * and deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8
+ *
+ * Used on declarations introduced in GRMustache 6.0,
+ * but later deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8
+ *
+ * Used on declarations introduced in GRMustache 6.1,
+ * but later deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8
+ *
+ * Used on declarations introduced in GRMustache 6.2,
+ * but later deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8
+ *
+ * Used on declarations introduced in GRMustache 6.3,
+ * but later deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8
+ *
+ * Used on declarations introduced in GRMustache 6.4,
+ * but later deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8
+ *
+ * Used on declarations introduced in GRMustache 6.5,
+ * but later deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 AVAILABLE_GRMUSTACHE_VERSION_6_5_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8
+ *
+ * Used on declarations introduced in GRMustache 6.6,
+ * but later deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8
+ *
+ * Used on declarations introduced in GRMustache 6.7,
+ * but later deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8 AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_8_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 6.8
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_8
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_8_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_8_AND_LATER
+#endif
View
140 Classes/Headers/External Libraries/GRMustacheConfiguration.h
@@ -21,15 +21,40 @@
// THE SOFTWARE.
#import <Foundation/Foundation.h>
-
#import "GRMustacheAvailabilityMacros.h"
-#import "GRMustacheContentType.h"
@class GRMustacheContext;
-
@protocol GRMustacheTagDelegate;
/**
+ * The content type of strings rendered by templates.
+ *
+ * @see GRMustacheConfiguration
+ * @see GRMustacheTemplateRepository
+ *
+ * @since v6.2
+ */
+typedef NS_ENUM(NSUInteger, GRMustacheContentType) {
+ /**
+ * The `GRMustacheContentTypeHTML` content type has templates render HTML.
+ * HTML template escape the input of variable tags such as `{{name}}`. Use
+ * triple mustache tags `{{{content}}}` in order to avoid the HTML-escaping.
+ *
+ * @since v6.2
+ */
+ GRMustacheContentTypeHTML AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER,
+
+ /**
+ * The `GRMustacheContentTypeText` content type has templates render text.
+ * They do not HTML-escape their input: `{{name}}` and `{{{name}}}` have
+ * identical renderings.
+ *
+ * @since v6.2
+ */
+ GRMustacheContentTypeText AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER,
+} AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER;
+
+/**
* A GRMustacheConfiguration instance configures GRMustache rendering.
*
* **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/configuration.md
@@ -37,33 +62,27 @@
* The default configuration [GRMustacheConfiguration defaultConfiguration]
* applies to all GRMustache rendering by default:
*
- * ```
- * // Have GRMustache templates render text by default,
- * // and do not HTML-escape their input.
- * [GRMustacheConfiguration defaultConfiguration].contentType = GRMustacheContentTypeText;
- * ```
+ * // Have GRMustache templates render text by default,
+ * // and do not HTML-escape their input.
+ * [GRMustacheConfiguration defaultConfiguration].contentType = GRMustacheContentTypeText;
*
* You can also alter the configuration of a specific template repository: its
* configuration only applies to the templates built by this very template
* repository:
*
- * ```
- * // All templates loaded from _repo_ will use [[ and ]] as tag delimiters.
- * GRMustacheTemplateRepository *repo = [GRMustacheTemplateRepository templateRepositoryWithBundle:nil];
- * repo.configuration.tagStartDelimiter = @"[[";
- * repo.configuration.tagEndDelimiter = @"]]";
- * ```
+ * // All templates loaded from _repo_ will use [[ and ]] as tag delimiters.
+ * GRMustacheTemplateRepository *repo = [GRMustacheTemplateRepository templateRepositoryWithBundle:nil];
+ * repo.configuration.tagStartDelimiter = @"[[";
+ * repo.configuration.tagEndDelimiter = @"]]";
*
* A third option is to create a new configuration, and assign it to the template:
*
- * ```
- * // Create a configuration
- * GRMustacheConfiguration *configuration = [GRMustacheConfiguration configuration];
- * configuration.... // setup
+ * // Create a configuration
+ * GRMustacheConfiguration *configuration = [GRMustacheConfiguration configuration];
+ * configuration.... // setup
*
- * GRMustacheTemplateRepository *repo = [GRMustacheTemplateRepository templateRepositoryWithBundle:nil];
- * repo.configuration = configuration;
- * ```
+ * GRMustacheTemplateRepository *repo = [GRMustacheTemplateRepository templateRepositoryWithBundle:nil];
+ * repo.configuration = configuration;
*
* The `contentType` option can be specified at the template level, so that your
* repositories can mix HTML and text templates: see the documentation of this
@@ -104,7 +123,7 @@
*
* @since v6.2
*/
-+ (GRMustacheConfiguration *)defaultConfiguration AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (GRMustacheConfiguration *)defaultConfiguration AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER;
////////////////////////////////////////////////////////////////////////////////
@@ -120,7 +139,7 @@
*
* @since v6.2
*/
-+ (GRMustacheConfiguration *)configuration AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (GRMustacheConfiguration *)configuration AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER;
////////////////////////////////////////////////////////////////////////////////
@@ -136,7 +155,7 @@
*
* @since v6.4
*/
-@property (nonatomic, retain) GRMustacheContext *baseContext AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic, retain) GRMustacheContext *baseContext AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
/**
* Extends the base context of the receiver with the provided object, making its
@@ -144,30 +163,24 @@
*
* For example:
*
- * ```
- * GRMustacheConfiguration *configuration = [GRMustacheConfiguration defaultConfiguration];
+ * GRMustacheConfiguration *configuration = [GRMustacheConfiguration defaultConfiguration];
*
- * // Have the `name` key defined for all template renderings:
- * id object = @{ @"name": @"Arthur" };
- * [configuration extendBaseContextWithObject:object];
+ * // Have the `name` key defined for all template renderings:
+ * id object = @{ @"name": @"Arthur" };
+ * [configuration importObject:object];
*
- * // Renders "Arthur"
- * [GRMustacheTemplate renderObject:nil fromString:@"{{name}}" error:NULL];
- * ```
+ * // Renders "Arthur"
+ * [GRMustacheTemplate renderObject:nil fromString:@"{{name}}" error:NULL];
*
* Keys defined by _object_ can be overriden by other objects that will
* eventually enter the context stack:
*
- * ```
- * // Renders "Billy", not "Arthur"
- * [GRMustacheTemplate renderObject:nil:@{ @"name": @"Billy" } fromString:@"{{name}}" error:NULL];
- * ```
+ * // Renders "Billy", not "Arthur"
+ * [GRMustacheTemplate renderObject:nil:@{ @"name": @"Billy" } fromString:@"{{name}}" error:NULL];
*
* This method is a shortcut. It is equivalent to the following line of code:
*
- * ```
- * configuration.baseContext = [configuration.baseContext contextByAddingObject:object];
- * ```
+ * configuration.baseContext = [configuration.baseContext contextByAddingObject:object];
*
* @param object An object
*
@@ -177,32 +190,29 @@
*
* @since v6.8
*/
-- (void)extendBaseContextWithObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (void)extendBaseContextWithObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER;
/**
* Extends the base context of the receiver with the provided object, making its
* keys available for all renderings.
*
- * Keys defined by _object_ are given priority, which means that they can not be
+ * Keys defined by _object_ gets "protected", which means that they can not be
* overriden by other objects that will eventually enter the context stack.
*
* For example:
*
- * ```
- * GRMustacheConfiguration *configuration = [GRMustacheConfiguration defaultConfiguration];
+ * GRMustacheConfiguration *configuration = [GRMustacheConfiguration defaultConfiguration];
*
- * // The `precious` key is given priority:
- * [configuration extendBaseContextWithProtectedObject:@{ @"precious": @"gold" }];
+ * // Have the `precious` key defined, and protected, for all template renderings:
+ * id object = @{ @"precious": @"gold" };
+ * [configuration importObject:object];
*
- * // Renders "gold", not "lead".
- * [GRMustacheTemplate renderObject:nil:@{ @"precious": @"lead" } fromString:@"{{precious}}" error:NULL];
- * ```
+ * // Renders "gold"
+ * [GRMustacheTemplate renderObject:nil:@{ @"precious": @"lead" } fromString:@"{{precious}}" error:NULL];
*
* This method is a shortcut. It is equivalent to the following line of code:
*
- * ```
- * configuration.baseContext = [configuration.baseContext contextByAddingProtectedObject:object];
- * ```
+ * configuration.baseContext = [configuration.baseContext contextByAddingProtectedObject:object];
*
* @param object An object
*
@@ -212,7 +222,7 @@
*
* @since v6.8
*/
-- (void)extendBaseContextWithProtectedObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;;
+- (void)extendBaseContextWithProtectedObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER;;
/**
* Extends the base context of the receiver with a tag delegate, making it aware
@@ -220,9 +230,7 @@
*
* This method is a shortcut. It is equivalent to the following line of code:
*
- * ```
- * configuration.baseContext = [configuration.baseContext contextByAddingTagDelegate:tagDelegate];
- * ```
+ * configuration.baseContext = [configuration.baseContext contextByAddingTagDelegate:tagDelegate];
*
* @param tagDelegate A tag delegate
*
@@ -232,7 +240,7 @@
*
* @since v6.8
*/
-- (void)extendBaseContextWithTagDelegate:(id<GRMustacheTagDelegate>)tagDelegate AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;;
+- (void)extendBaseContextWithTagDelegate:(id<GRMustacheTagDelegate>)tagDelegate AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER;;
/**
* The content type of strings rendered by templates.
@@ -261,37 +269,35 @@
*
* Insert those pragma tags early in your templates. For example:
*
- * ```
- * {{! This template renders a bash script. }}
- * {{% CONTENT_TYPE:TEXT }}
- * export LANG={{ENV.LANG}}
- * ...
- * ```
+ * {{! This template renders a bash script. }}
+ * {{% CONTENT_TYPE:TEXT }}
+ * export LANG={{ENV.LANG}}
+ * ...
*
* Should two such pragmas be found in a template content, the last one wins.
*
* @since v6.2
*/
-@property (nonatomic) GRMustacheContentType contentType AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic) GRMustacheContentType contentType AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER;
/**
- * The opening delimiter for Mustache tags. Its default value is `{{`.
+ * The opening delimiter for Mustache tags. Its default value is @"{{".
*
* You can also change the delimiters right in your templates using a "Set
* Delimiter tag": {{=[[ ]]=}} changes start and end delimiters to [[ and ]].
*
* @since v6.4
*/
-@property (nonatomic, copy) NSString *tagStartDelimiter AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic, copy) NSString *tagStartDelimiter AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
/**
- * The closing delimiter for Mustache tags. Its default value is `}}`.
+ * The closing delimiter for Mustache tags. Its default value is @"}}".
*
* You can also change the delimiters right in your templates using a "Set
* Delimiter tag": {{=[[ ]]=}} changes start and end delimiters to [[ and ]].
*
* @since v6.4
*/
-@property (nonatomic, copy) NSString *tagEndDelimiter AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic, copy) NSString *tagEndDelimiter AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
@end
View
54 Classes/Headers/External Libraries/GRMustacheContentType.h
@@ -1,54 +0,0 @@
-// The MIT License
-//
-// Copyright (c) 2014 Gwendal Roué
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <Foundation/Foundation.h>
-
-#import "GRMustacheAvailabilityMacros.h"
-
-/**
- * The content type of strings rendered by templates.
- *
- * @see GRMustacheConfiguration
- * @see GRMustacheTemplateRepository
- *
- * @since v6.2
- */
-typedef NS_ENUM(NSUInteger, GRMustacheContentType) {
- /**
- * The `GRMustacheContentTypeHTML` content type has templates render HTML.
- * HTML template escape the input of variable tags such as `{{name}}`. Use
- * triple mustache tags `{{{content}}}` in order to avoid the HTML-escaping.
- *
- * @since v6.2
- */
- GRMustacheContentTypeHTML AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER,
-
- /**
- * The `GRMustacheContentTypeText` content type has templates render text.
- * They do not HTML-escape their input: `{{name}}` and `{{{name}}}` have
- * identical renderings.
- *
- * @since v6.2
- */
- GRMustacheContentTypeText AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER,
-} AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
-
View
313 Classes/Headers/External Libraries/GRMustacheContext.h
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2014 Gwendal Roué
+// Copyright (c) 2013 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -20,11 +20,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+#import <objc/message.h>
#import <Foundation/Foundation.h>
-
#import "GRMustacheAvailabilityMacros.h"
-
-@protocol GRMustacheTagDelegate;
+#import "GRMustacheTagDelegate.h"
/**
* The GRMustacheContext represents a Mustache rendering context: it internally
@@ -33,7 +32,7 @@
* - a *context stack*, that makes it able to provide the current context
* object, and to perform key lookup.
*
- * - a *priority context stack*, whose objects define important keys that
+ * - a *protected context stack*, whose objects define important keys that
* should not be overriden.
*
* - a *tag delegate stack*, so that tag delegates are notified when a Mustache
@@ -44,27 +43,24 @@
* - https://github.com/groue/GRMustache/blob/master/Guides/view_model.md
* - https://github.com/groue/GRMustache/blob/master/Guides/delegate.md
* - https://github.com/groue/GRMustache/blob/master/Guides/rendering_objects.md
- * - https://github.com/groue/GRMustache/blob/master/Guides/security.md
- *
- * @warning GRMustacheContext is not suitable for subclassing.
+ * - https://github.com/groue/GRMustache/blob/master/Guides/protected_contexts.md
*
* @see GRMustacheRendering protocol
*/
@interface GRMustacheContext : NSObject {
@private
-#define GRMUSTACHE_STACK_TOP_IVAR(stackName) _ ## stackName ## Object
-#define GRMUSTACHE_STACK_PARENT_IVAR(stackName) _ ## stackName ## Parent
-#define GRMUSTACHE_STACK_DECLARE_IVARS(stackName, type) \
- GRMustacheContext *GRMUSTACHE_STACK_PARENT_IVAR(stackName); \
- type GRMUSTACHE_STACK_TOP_IVAR(stackName)
-
- GRMUSTACHE_STACK_DECLARE_IVARS(contextStack, id);
- GRMUSTACHE_STACK_DECLARE_IVARS(protectedContextStack, id);
- GRMUSTACHE_STACK_DECLARE_IVARS(hiddenContextStack, id);
- GRMUSTACHE_STACK_DECLARE_IVARS(tagDelegateStack, id<GRMustacheTagDelegate>);
- GRMUSTACHE_STACK_DECLARE_IVARS(inheritablePartialStack, id);
-
- BOOL _unsafeKeyAccess;
+ GRMustacheContext *_contextParent;
+ id _contextObject;
+ NSMutableDictionary *_managedPropertiesStore;
+ GRMustacheContext *_protectedContextParent;
+ id _protectedContextObject;
+ GRMustacheContext *_hiddenContextParent;
+ id _hiddenContextObject;
+ GRMustacheContext *_tagDelegateParent;
+ id<GRMustacheTagDelegate> _tagDelegate;
+ GRMustacheContext *_templateOverrideParent;
+ id _templateOverride;
+ NSDictionary *_depthsForAncestors;
}
@@ -81,9 +77,7 @@
* you should create a context with the +[GRMustacheContext contextWithObject:]
* method, like this:
*
- * ```
- * [GRMustacheContext contextWithObject:[GRMustache standardLibrary]]
- * ```
+ * [GRMustacheContext contextWithObject:[GRMustache standardLibrary]]
*
* @return A rendering context.
*
@@ -100,9 +94,7 @@
* you should create a context with the +[GRMustacheContext contextWithObject:]
* method, like this:
*
- * ```
- * [GRMustacheContext contextWithObject:[GRMustache standardLibrary]]
- * ```
+ * [GRMustacheContext contextWithObject:[GRMustache standardLibrary]]
*
* @return A rendering context.
*
@@ -111,21 +103,23 @@
*
* @since v6.4
*/
-+ (instancetype)context AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (instancetype)context AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
/**
* Returns a rendering context containing a single object.
*
* Keys defined by _object_ gets available for template rendering.
*
- * ```
- * context = [GRMustacheContext contextWithObject:@{ @"name": @"Arthur" }];
- * [context valueForMustacheKey:@"name"]; // @"Arthur"
- * ```
+ * context = [GRMustacheContext contextWithObject:@{ @"name": @"Arthur" }];
+ * [context valueForMustacheKey:@"name"]; // @"Arthur"
*
* If _object_ conforms to the GRMustacheTemplateDelegate protocol, it is also
* made the top of the tag delegate stack.
*
+ * If _object_ is an instance of GRMustacheContext, its class must be the class
+ * of the receiver, or any subclass, and the returned context is _object.
+ * An exception is raised otherwise.
+ *
* **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/delegate.md
*
* @param object An object
@@ -138,26 +132,24 @@
*
* @since v6.4
*/
-+ (instancetype)contextWithObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (instancetype)contextWithObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
/**
- * Returns a context containing a single priority object.
+ * Returns a context containing a single protected object.
*
- * Keys defined by _object_ are given priority, which means that they can not be
+ * Keys defined by _object_ gets "protected", which means that they can not be
* overriden by other objects that will eventually enter the context stack.
*
- * ```
- * // Create a context with a priority `precious` key
- * context = [GRMustacheContext contextWithProtectedObject:@{ @"precious": @"gold" }];
+ * // Create a context with a protected `precious` key
+ * context = [GRMustacheContext contextWithProtectedObject:@{ @"precious": @"gold" }];
*
- * // Derive a new context by attempting to override the `precious` key:
- * context = [context contextByAddingObject:@{ @"precious": @"lead" }];
+ * // Derive a new context by attempting to override the `precious` key:
+ * context = [context contextByAddingObject:@{ @"precious": @"lead" }];
*
- * // Priority keys can't be overriden
- * [context valueForMustacheKey:@"precious"]; // @"gold"
- * ```
+ * // Protected keys can't be overriden
+ * [context valueForMustacheKey:@"precious"]; // @"gold"
*
- * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/security.md#priority-keys
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/protected_context.md
*
* @param object An object
*
@@ -167,7 +159,7 @@
*
* @since v6.4
*/
-+ (instancetype)contextWithProtectedObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (instancetype)contextWithProtectedObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
/**
* Returns a context containing a single tag delegate.
@@ -189,7 +181,7 @@
*
* @since v6.4
*/
-+ (instancetype)contextWithTagDelegate:(id<GRMustacheTagDelegate>)tagDelegate AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (instancetype)contextWithTagDelegate:(id<GRMustacheTagDelegate>)tagDelegate AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
////////////////////////////////////////////////////////////////////////////////
@@ -205,24 +197,26 @@
* the values defined by objects already contained in the context stack. Keys
* unknown to _object_ will be looked up deeper in the context stack.
*
- * ```
- * context = [GRMustacheContext contextWithObject:@{ @"a": @"ignored", @"b": @"foo" }];
- * context = [context contextByAddingObject:@{ @"a": @"bar" }];
+ * context = [GRMustacheContext contextWithObject:@{ @"a": @"ignored", @"b": @"foo" }];
+ * context = [context contextByAddingObject:@{ @"a": @"bar" }];
*
- * // `a` is overriden
- * [context valueForMustacheKey:@"a"]; // @"bar"
+ * // `a` is overriden
+ * [context valueForMustacheKey:@"a"]; // @"bar"
*
- * // `b` is inherited
- * [context valueForMustacheKey:@"b"]; // @"foo"
- * ```
+ * // `b` is inherited
+ * [context valueForMustacheKey:@"b"]; // @"foo"
*
- * _object_ can not override keys defined by the objects of the priority
+ * _object_ can not override keys defined by the objects of the protected
* context stack, though. See contextWithProtectedObject: and
* contextByAddingProtectedObject:.
*
* If _object_ conforms to the GRMustacheTemplateDelegate protocol, it is also
* added at the top of the tag delegate stack.
*
+ * If _object_ is an instance of GRMustacheContext, its class must be the class
+ * of the receiver, or any subclass, and the returned context will be an
+ * instance of the class of _object_. An exception is raised otherwise.
+ *
* **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/delegate.md
*
* @param object An object
@@ -233,27 +227,25 @@
*
* @since v6.0
*/
-- (instancetype)contextByAddingObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (instancetype)contextByAddingObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
* Returns a new rendering context that is the copy of the receiver, and the
- * given object added at the top of the priority context stack.
+ * given object added at the top of the protected context stack.
*
- * Keys defined by _object_ are given priority, which means that they can not be
+ * Keys defined by _object_ gets "protected", which means that they can not be
* overriden by other objects that will eventually enter the context stack.
*
- * ```
- * // Derive a context with a priority `precious` key
- * context = [context contextByAddingProtectedObject:@{ @"precious": @"gold" }];
+ * // Derive a context with a protected `precious` key
+ * context = [context contextByAddingProtectedObject:@{ @"precious": @"gold" }];
*
- * // Derive a new context by attempting to override the `precious` key:
- * context = [context contextByAddingObject:@{ @"precious": @"lead" }];
+ * // Derive a new context by attempting to override the `precious` key:
+ * context = [context contextByAddingObject:@{ @"precious": @"lead" }];
*
- * // Priority keys can't be overriden
- * [context valueForMustacheKey:@"precious"]; // @"gold"
- * ```
+ * // Protected keys can't be overriden
+ * [context valueForMustacheKey:@"precious"]; // @"gold"
*
- * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/security.md#priority-keys
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/protected_context.md
*
* @param object An object
*
@@ -261,7 +253,7 @@
*
* @since v6.0
*/
-- (instancetype)contextByAddingProtectedObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (instancetype)contextByAddingProtectedObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
* Returns a new rendering context that is the copy of the receiver, and the
@@ -284,7 +276,7 @@
*
* @since v6.0
*/
-- (instancetype)contextByAddingTagDelegate:(id<GRMustacheTagDelegate>)tagDelegate AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (instancetype)contextByAddingTagDelegate:(id<GRMustacheTagDelegate>)tagDelegate AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
////////////////////////////////////////////////////////////////////////////////
@@ -297,11 +289,9 @@
* The returned object is the same as the one that would be rendered by a
* `{{ . }}` tag.
*
- * ```
- * user = ...;
- * context = [GRMustacheContext contextWithObject:user];
- * context.topMustacheObject; // user
- * ```
+ * user = ...;
+ * context = [GRMustacheContext contextWithObject:user];
+ * context.topMustacheObject; // user
*
* @return The object at the top of the receiver's context stack.
*
@@ -310,174 +300,107 @@
*
* @since v6.7
*/
-@property (nonatomic, readonly) id topMustacheObject AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic, readonly) id topMustacheObject AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER;
/**
* Returns the value stored in the context stack for the given key.
*
- * If you want the value for an full expression such as `user.name` or
- * `uppercase(user.name)`, use the hasValue:forMustacheExpression:error:
+ * If you want the value for an full expression such as @"user.name" or
+ * @"uppercase(user.name)", use the hasValue:forMustacheExpression:error:
* method.
*
- * ### Search Pattern for valueForMustacheKey
- *
- * The Mustache value of any object for a given key is defined as:
- *
- * 1. If the object responds to the `objectForKeyedSubscript:` instance method,
- * return the result of this method.
+ * ### Search Pattern for valueForMustacheKey:
*
- * 2. Otherwise, build the list of safe keys:
- * a. If the object responds to the `safeMustacheKeys` class method defined
- * by the `GRMustacheSafeKeyAccess` protocol, use this method.
- * b. Otherwise, use the list of Objective-C properties declared with
- * `@property`.
- * c. If object is an instance of NSManagedObject, add all the attributes of
- * its Core Data entity.
+ * When the default implementation of valueForMustacheKey: is invoked on a
+ * receiver, the following search pattern is used:
*
- * 3. If the key belongs to the list of safe keys, return the result of the
- * `valueForKey:` method, unless this method throws NSUndefinedKeyException.
+ * 1. Searches the protected context stack for an object whose valueForKey:
+ * method returns a non-nil value.
*
- * 4. Otherwise, return nil.
+ * 2. Otherwise (irrelevant protected context stack), search the context stack
+ * for an object whose valueForKey: method returns a non-nil value, or for an
+ * initialized managed property (managed properties are properties defined by
+ * GRMustacheContext subclasses as @dynamic).
*
- * Contexts with unsafe key access skip the key validation step.
+ * 3. Otherwise (irrelevant protected context stack, irrelevant regular context
+ * stack, no initialized managed property), performs a regular call to
+ * `valueForKey:` on the receiver, so that methods defined by subclasses can
+ * provide default values.
*
- * In this method, the following search pattern is used:
+ * 4. If none of the above situations occurs, returns the result of
+ * valueForUndefinedMustacheKey:.
*
- * 1. Searches the priority context stack for an object that has a non-nil
- * Mustache value for the key.
- *
- * 2. Otherwise (irrelevant priority context stack), search the context stack
- * for an object that has a non-nil Mustache value for the key.
- *
- * 3. If none of the above situations occurs, returns nil.
- *
- * **Companion guides:** https://github.com/groue/GRMustache/blob/master/Guides/runtime.md,
- * https://github.com/groue/GRMustache/blob/master/Guides/view_model.md
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/view_model.md
*
* @param key a key such as @"name"
*
* @return The value found in the context stack for the given key.
*
- * @see contextWithUnsafeKeyAccess
+ * @see valueForUndefinedMustacheKey:
* @see hasValue:forMustacheExpression:error:
*
* @since v6.6
*/
-- (id)valueForMustacheKey:(NSString *)key AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (id)valueForMustacheKey:(NSString *)key AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER;
/**
- * Evaluates an expression such as `name`, or `uppercase(user.name)`.
+ * This method is invoked when a key could not be resolved to any value.
+ *
+ * Subclasses can override this method to return an alternate value for
+ * undefined keys. The default implementation returns nil.
*
* **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/view_model.md
*
- * @param value Upon return contains the value of the expression.
- * @param expression An expression.
- * @param error If there is an error computing the value, upon return
- * contains an NSError object that describes the problem.
+ * @param key a key such as @"name"
*
- * @return YES if the value could be computed.
+ * @return The value for the given key.
*
* @see valueForMustacheKey:
+ * @see hasValue:forMustacheExpression:error:
*
- * @since v6.8
- */
-- (BOOL)hasValue:(id *)value forMustacheExpression:(NSString *)expression error:(NSError **)error AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
-
-
-////////////////////////////////////////////////////////////////////////////////
-/// @name Unsafe Key Access
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * Returns whether this context allows unsafe key access or not.
- *
- * @since v7.0
+ * @since v6.7
*/
-@property (nonatomic, readonly) BOOL unsafeKeyAccess AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (id)valueForUndefinedMustacheKey:(NSString *)key AVAILABLE_GRMUSTACHE_VERSION_6_7_AND_LATER;
/**
- * Returns a new context with unsafe key access.
- *
- * Unsafe key access allows this context, and all contexts derived from it, to
- * access keys that are normally forbidden: keys that are not declared as
- * Objective-C properties, or keys that do not belong to the result of the
- * `safeMustacheKeys` method.
- *
- * Compare:
- *
- * ```
- * @interface DBRecord : NSObject
- * - (void)deleteRecord;
- * @end
- *
- * @implementation DBRecord
- * - (void)deleteRecord
- * {
- *     NSLog(@"Oooops, your record was just deleted!");
- * }
- * @end
+ * Evaluates an expression such as @"name", or @"uppercase(user.name)".
*
- * DBRecord *record = ...;
- * NSString *templateString = @"{{ deleteRecord }}";
- * GRMustacheTemplate * template = [GRMustacheTemplate templateWithString:templateString error:NULL];
+ * This method is deprecated. You should use the
+ * hasValue:forMustacheExpression:error: method instead.
*
- * // Safe rendering of the dangerous template: record is not deleted.
- * [template renderObject:record error:NULL];
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/view_model.md
*
- * // Unsafe rendering of the dangerous template: record is deleted.
- * template.baseContext = [GRMustacheContext contextWithUnsafeKeyAccess];
- * [template renderObject:record error:NULL];
- * ```
+ * @param expression An expression such as @"name", @"user.name", or
+ * @"uppercase(user.name)".
+ * @param error If there is an error computing the value, upon return
+ * contains an NSError object that describes the problem.
*
- * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/security.md
+ * @return The computed value
*
- * @see GRMustacheSafeKeyAccess
+ * @see hasValue:forMustacheExpression:error:
*
- * @since v7.0
+ * @since v6.6
+ * @deprecated v6.8
*/
-+ (instancetype)contextWithUnsafeKeyAccess AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (id)valueForMustacheExpression:(NSString *)expression error:(NSError **)error AVAILABLE_GRMUSTACHE_VERSION_6_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_8;
/**
- * Returns a new rendering context that is the copy of the receiver, with unsafe
- * key access.
- *
- * Unsafe key access allows this context, and all contexts derived from it, to
- * access keys that are normally forbidden: keys that are not declared as
- * Objective-C properties, or keys that do not belong to the result of the
- * `safeMustacheKeys` method.
+ * Evaluates an expression such as @"name", or @"uppercase(user.name)".
*
- * Compare:
- *
- * ```
- * @interface DBRecord : NSObject
- * - (void)deleteRecord;
- * @end
- *
- * @implementation DBRecord
- * - (void)deleteRecord
- * {
- *     NSLog(@"Oooops, your record was just deleted!");
- * }
- * @end
- *
- * DBRecord *record = ...;
- * NSString *templateString = @"{{ deleteRecord }}";
- * GRMustacheTemplate * template = [GRMustacheTemplate templateWithString:templateString error:NULL];
- *
- * // Safe rendering of the dangerous template: record is not deleted.
- * [template renderObject:record error:NULL];
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/view_model.md
*
- * // Unsafe rendering of the dangerous template: record is deleted.
- * template.baseContext = [template.baseContext contextWithUnsafeKeyAccess];
- * [template renderObject:record error:NULL];
- * ```
+ * @param value Upon return contains the value of the expression.
+ * @param expression An expression.
+ * @param error If there is an error computing the value, upon return
+ * contains an NSError object that describes the problem.
*
- * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/security.md
+ * @return YES if the value could be computed.
*
- * @see GRMustacheSafeKeyAccess
+ * @see valueForMustacheKey:
+ * @see valueForUndefinedMustacheKey:
*
- * @since v7.0
+ * @since v6.8
*/
-- (instancetype)contextWithUnsafeKeyAccess AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (BOOL)hasValue:(id *)value forMustacheExpression:(NSString *)expression error:(NSError **)error AVAILABLE_GRMUSTACHE_VERSION_6_8_AND_LATER;
@end
View
15 Classes/Headers/External Libraries/GRMustacheError.h
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2014 Gwendal Roué
+// Copyright (c) 2013 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -21,7 +21,6 @@
// THE SOFTWARE.
#import <Foundation/Foundation.h>
-
#import "GRMustacheAvailabilityMacros.h"
@@ -36,23 +35,23 @@ typedef NS_ENUM(NSInteger, GRMustacheErrorCode) {
*
* @since v1.0
*/
- GRMustacheErrorCodeParseError AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER,
+ GRMustacheErrorCodeParseError AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER,
/**
* The error code for not found templates and partials.
*
* @since v1.0
*/
- GRMustacheErrorCodeTemplateNotFound AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER,
+ GRMustacheErrorCodeTemplateNotFound AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER,
/**
* The error code for not rendering errors.
*
* @since v6.3
*/
- GRMustacheErrorCodeRenderingError AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER,
+ GRMustacheErrorCodeRenderingError AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER,
-} AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+} AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
@@ -60,7 +59,7 @@ typedef NS_ENUM(NSInteger, GRMustacheErrorCode) {
*
* @since v1.0
*/
-extern NSString *const GRMustacheErrorDomain AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+extern NSString *const GRMustacheErrorDomain AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
@@ -68,5 +67,5 @@ extern NSString *const GRMustacheErrorDomain AVAILABLE_GRMUSTACHE_VERSION_7_0_AN
*
* @since v5.1
*/
-extern NSString *const GRMustacheRenderingException AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+extern NSString *const GRMustacheRenderingException AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
View
14 Classes/Headers/External Libraries/GRMustacheFilter.h
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2014 Gwendal Roué
+// Copyright (c) 2013 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -20,11 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#ifndef GRMUSTACHE_FILTER
-#define GRMUSTACHE_FILTER
-
#import <Foundation/Foundation.h>
-
#import "GRMustacheAvailabilityMacros.h"
@@ -61,7 +57,7 @@
*
* @since v4.3
*/
-- (id)transformedValue:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (id)transformedValue:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
@end
@@ -98,7 +94,7 @@
*
* @see variadicFilterWithBlock:
*/
-+ (id<GRMustacheFilter>)filterWithBlock:(id(^)(id value))block AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (id<GRMustacheFilter>)filterWithBlock:(id(^)(id value))block AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
* Returns a GRMustacheFilter object that executes the provided block, given an
@@ -119,8 +115,6 @@
*
* @see filterWithBlock:
*/
-+ (id<GRMustacheFilter>)variadicFilterWithBlock:(id(^)(NSArray *arguments))block AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
++ (id<GRMustacheFilter>)variadicFilterWithBlock:(id(^)(NSArray *arguments))block AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
@end
-
-#endif
View
15 Classes/Headers/External Libraries/GRMustacheLocalizer.h
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2014 Gwendal Roué
+// Copyright (c) 2013 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -21,7 +21,6 @@
// THE SOFTWARE.
#import <Foundation/Foundation.h>
-
#import "GRMustacheAvailabilityMacros.h"
#import "GRMustacheRendering.h"
#import "GRMustacheFilter.h"
@@ -39,7 +38,7 @@
* ### Localizing data:
*
* `{{ localize(greeting) }}` renders `NSLocalizedString(@"Hello", nil)`,
- * assuming the `greeting` key resolves to the `Hello` string.
+ * assuming the `greeting` key resolves to the @"Hello" string.
*
* ### Localizing sections:
*
@@ -48,13 +47,13 @@
* ### Localizing sections with arguments:
*
* `{{#localize}}Hello {{name}}{{/localize}}` builds the format string
- * `Hello %@`, localizes it with NSLocalizedString, and finally
+ * @"Hello %@", localizes it with NSLocalizedString, and finally
* injects the name with `[NSString stringWithFormat:]`.
*
* ### Localize sections with arguments and conditions:
*
* `{{#localize}}Good morning {{#title}}{{title}}{{/title}} {{name}}{{/localize}}`
- * build the format string `Good morning %@" or @"Good morning %@ %@`,
+ * build the format string @"Good morning %@" or @"Good morning %@ %@",
* depending on the presence of the `title` key. It then injects the name, or
* both title and name, with `[NSString stringWithFormat:]`, to build the final
* rendering.
@@ -86,14 +85,14 @@
*
* @since v6.4
*/
-- (id)initWithBundle:(NSBundle *)bundle tableName:(NSString *)tableName AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+- (id)initWithBundle:(NSBundle *)bundle tableName:(NSString *)tableName AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
/**
* The bundle where to look for localized strings.
*
* @since v6.4
*/
-@property (nonatomic, retain, readonly) NSBundle *bundle AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic, retain, readonly) NSBundle *bundle AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
/**
* The table where to look for localized strings.
@@ -102,7 +101,7 @@
*
* @since v6.4
*/
-@property (nonatomic, retain, readonly) NSString *tableName AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic, retain, readonly) NSString *tableName AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
@end
View
67 Classes/Headers/External Libraries/GRMustacheRendering.h
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2014 Gwendal Roué
+// Copyright (c) 2013 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -20,21 +20,12 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#ifndef GRMUSTACHE_RENDERING
-#define GRMUSTACHE_RENDERING
-
#import <Foundation/Foundation.h>
-
#import "GRMustacheAvailabilityMacros.h"
@class GRMustacheContext;
@class GRMustacheTag;
-
-// =============================================================================
-#pragma mark - <GRMustacheRendering>
-
-
/**
* The protocol for your own objects that perform custom rendering.
*
@@ -71,60 +62,6 @@
- (NSString *)renderForMustacheTag:(GRMustacheTag *)tag
context:(GRMustacheContext *)context
HTMLSafe:(BOOL *)HTMLSafe
- error:(NSError **)error AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
-
-@end
-
-
-// =============================================================================
-#pragma mark - GRMustacheRendering
-
-/**
- * The GRMustacheRendering class helps building rendering objects without
- * writing a custom class that conforms to the GRMustacheRendering protocol.
- *
- * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/rendering_objects.md
- *
- * @see GRMustacheRendering protocol
- *
- * @since v7.0
- */
-@interface GRMustacheRendering : NSObject<GRMustacheRendering>
-
-////////////////////////////////////////////////////////////////////////////////
-/// @name Creating Rendering Objects
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * Returns a rendering object that is able to render the argument _object_ for
- * the various Mustache tags.
- *
- * @param object An object.
- *
- * @return A rendering object able to render the argument.
- *
- * @see GRMustacheRendering protocol
- *
- * @since v7.0
- */
-+ (id<GRMustacheRendering>)renderingObjectForObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
-
-/**
- * Returns a rendering object that renders with the provided block.
- *
- * @param block A block that follows the semantics of the
- * renderForMustacheTag:context:HTMLSafe:error: method defined by
- * the GRMustacheRendering protocol. See the documentation of this
- * method.
- *
- * @return A rendering object
- *
- * @see GRMustacheRendering protocol
- *
- * @since v7.0
- */
-+ (id<GRMustacheRendering>)renderingObjectWithBlock:(NSString *(^)(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error))block AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+ error:(NSError **)error AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
@end
-
-#endif
View
55 Classes/Headers/External Libraries/GRMustacheSafeKeyAccess.h
@@ -1,55 +0,0 @@
-// The MIT License
-//
-// Copyright (c) 2014 Gwendal Roué
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#import <Foundation/Foundation.h>
-
-#import "GRMustacheAvailabilityMacros.h"
-
-
-/**
- * Your data classes should conform to the GRMustacheSafeKeyAccess protocol
- * to filter the keys that can be accessed by GRMustache templates.
- *
- * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/runtime/security.md
- */
-@protocol GRMustacheSafeKeyAccess <NSObject>
-
-/**
- * List the name of the keys GRMustache can access on this class using the
- * `valueForKey:` method.
- *
- * When objects do not respond to this method, only declared properties can be
- * accessed. All properties of Core Data NSManagedObjects are also accessible,
- * even without property declaration.
- *
- * This method is not used for objects responding to `objectForKeyedSubscript:`.
- * For those objects, all keys are accessible from templates.
- *
- * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/security.md
- *
- * @return The set of accessible keys on the class.
- *
- * @since v7.0
- */
-+ (NSSet *)safeMustacheKeys AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
-
-@end
View
51 Classes/Headers/External Libraries/GRMustacheTag.h
@@ -1,6 +1,6 @@
// The MIT License
//
-// Copyright (c) 2014 Gwendal Roué
+// Copyright (c) 2013 Gwendal Roué
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -21,7 +21,6 @@
// THE SOFTWARE.
#import <Foundation/Foundation.h>
-
#import "GRMustacheAvailabilityMacros.h"
#import "GRMustacheConfiguration.h"
@@ -38,22 +37,29 @@ typedef NS_ENUM(NSUInteger, GRMustacheTagType) {
*
* @since v6.0
*/
- GRMustacheTagTypeVariable = 1 << 1 AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER,
+ GRMustacheTagTypeVariable = 1 << 1 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER,
/**
* The type for section tags such as {{# name }}...{{/}}
*
* @since v6.0
*/
- GRMustacheTagTypeSection = 1 << 2 AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER,
+ GRMustacheTagTypeSection = 1 << 2 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER,
+
+ /**
+ * The type for overridable section tags such as {{$ name }}...{{/}}
+ *
+ * @since v6.0
+ */
+ GRMustacheTagTypeOverridableSection = 1 << 3 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER,
/**
* The type for inverted section tags such as {{^ name }}...{{/}}
*
* @since v6.0
*/
- GRMustacheTagTypeInvertedSection = 1 << 3 AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER,
-} AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+ GRMustacheTagTypeInvertedSection = 1 << 4 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER,
+} AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
@@ -69,6 +75,7 @@ typedef NS_ENUM(NSUInteger, GRMustacheTagType) {
@private
GRMustacheTagType _type;
id _expression;
+ GRMustacheTemplateRepository *_templateRepository;
GRMustacheContentType _contentType;
}
@@ -81,26 +88,24 @@ typedef NS_ENUM(NSUInteger, GRMustacheTagType) {
/**
* The type of the tag
*/
-@property (nonatomic, readonly) GRMustacheTagType type AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic, readonly) GRMustacheTagType type AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
* Returns the literal and unprocessed inner content of the tag.
*
- * A section tag such as `{{# name }}inner content{{/}}` returns `inner content`.
+ * A section tag such as `{{# name }}...{{/}}` returns @"...".
*
* Variable tags such as `{{ name }}` have no inner content: their inner
* template string is the empty string.
*/
-@property (nonatomic, readonly) NSString *innerTemplateString AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER;
+@property (nonatomic, readonly) NSString *innerTemplateString AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
* Returns the description of the tag.
*
* For example:
*
- * ```
- * <GRMustacheVariableTag `{{ name }}` at line 18 of template /path/to/Document.mustache>
- * ```
+ * <GRMustacheVariableTag `{{ name }}` at line 18 of template /path/to/Document.mustache>
*/
- (NSString *)description;
@@ -109,18 +114,22 @@ typedef NS_ENUM(NSUInteger, GRMustacheTagType) {
////////////////////////////////////////////////////////////////////////////////
/**
- * This method is deprecated.
+ * The template repository that did provide the template string from which the
+ * receiver tag has been extracted.
*
- * Replace `[tag.templateRepository templateFromString:... error:...]` with
- * `[GRMustacheTemplate templateFromString:... error:...]`.
+ * This method is intended for objects conforming to the GRMustacheRendering
+ * protocol who deal with templates including partial templates that come from
+ * various template repositories.
*
- * Replace `[tag.templateRepository templateNamed:... error:...]` with explicit
- * invocation of the targeted template repository.
+ * Caveat: Make sure you own (retain) template repositories. Don't use templates
+ * returned by methods like `[GRMustacheTemplate templateFrom...]`: they return
+ * autoreleased templates with an implicit autoreleased repository that will
+ * eventually be deallocated when your rendering object tries to access it.
*
- * @since v6.0
- * @deprecated v7.0
+ * @see GRMustacheRendering
+ * @see GRMustacheTemplateRepository
*/
-@property (nonatomic, readonly) GRMustacheTemplateRepository *templateRepository AVAILABLE_GRMUSTACHE_VERSION_7_0_AND_LATER_BUT_DEPRECATED;
+@property (nonatomic, readonly) GRMustacheTemplateRepository *templateRepository AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
/**
* Returns the rendering of the tag's inner content, rendering all inner