Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1B396200CD9 for ; Thu, 3 Aug 2017 23:20:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 19A5116C945; Thu, 3 Aug 2017 21:20:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 399E616C943 for ; Thu, 3 Aug 2017 23:20:09 +0200 (CEST) Received: (qmail 17198 invoked by uid 500); 3 Aug 2017 21:20:08 -0000 Mailing-List: contact notifications-help@freemarker.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.incubator.apache.org Delivered-To: mailing list notifications@freemarker.incubator.apache.org Received: (qmail 17189 invoked by uid 99); 3 Aug 2017 21:20:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2017 21:20:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 048D4C0286 for ; Thu, 3 Aug 2017 21:20:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.771 X-Spam-Level: X-Spam-Status: No, score=-3.771 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id HAUJzuN7beNQ for ; Thu, 3 Aug 2017 21:20:06 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 639F25FE66 for ; Thu, 3 Aug 2017 21:20:05 +0000 (UTC) Received: (qmail 16436 invoked by uid 99); 3 Aug 2017 21:20:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2017 21:20:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4F83DDFF9F; Thu, 3 Aug 2017 21:20:04 +0000 (UTC) From: ddekany To: notifications@freemarker.incubator.apache.org Reply-To: notifications@freemarker.incubator.apache.org Message-ID: Subject: [GitHub] incubator-freemarker pull request #30: FREEMARKER-63: Unification and improv... Content-Type: text/plain Date: Thu, 3 Aug 2017 21:20:04 +0000 (UTC) archived-at: Thu, 03 Aug 2017 21:20:10 -0000 GitHub user ddekany opened a pull request: https://github.com/apache/incubator-freemarker/pull/30 FREEMARKER-63: Unification and improvement of directive-like constructs Redesigned `TemplateDirectiveModel` now support both by position and by name parameter passing, even mixed in the same call. `#macros`-s also create `TemplateDirectiveModel`-s, and supports defining if a parameter is positional or named. Removed deprecated `TemplateTransformModel`. Added `TemplateFunctionModel`, which meant to replace `TemplateMethodModel` and `TemplateMethodModelEx` in another Jira issue, but for now it's only what `#function` creates. This also supports both positional and named parameters (though the call syntax in the expression language isn't updated in this issue, so it still only can pass positional parameters). `#function` was upgraded to support the same new features as `#macro`. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ddekany/incubator-freemarker FREEMARKER-63 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-freemarker/pull/30.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #30 ---- commit c28a78bd8dad4bfd3a37a90a26fbb15639d33604 Author: ddekany Date: 2017-07-24T18:26:29Z FREEMARKER-63: Very early state. Until it's fully functional, the new interface is called TemplateDirectiveModel2, and is invoked with <~...> instead of <@...>. Later it will replace TemplateDirectiveModel and the syntax will be <@...>. commit 46c750109ffe9e4c7e52e4c3df94b78c3445f780 Author: ddekany Date: 2017-07-26T21:48:11Z FREEMARKER-63: Very early state. Added support for nested content and loop variables. Added StringToIndexMap, which is used for mapping names to their index in the value arrays (a concept that we use at a few places now). commit fbbfadb443efac2009439564f1d3c664ff8a51b0 Author: ddekany Date: 2017-07-27T16:20:37Z FREEMARKER-63: Very early state. Some cleanups. Temporarily added support for calling legacy ASTDirMacro-s with the also temporary <~...>syntax. commit 146c42572c440dd4ef911d437239d3e54a7fe95b Author: ddekany Date: 2017-07-27T16:43:05Z FREEMARKER-63: Very early state. Simplified capturing assignment implementation commit 1e27397dd9570ac2f48be6100afd2bba7b42b8b8 Author: ddekany Date: 2017-07-27T18:45:01Z Removed the legacy predefined shared variables: "html_escape", "normalize_newlines", "xml_escape", "capture_output", "compress". It had to be done now as TemplateTransformModel will be removed as part of FREEMARKER-63. commit a6399a793f54f531a11a7a9d13b9eb47d648563a Author: ddekany Date: 2017-07-27T19:24:14Z FREEMARKER-63: Bit of API/javadoc cleanup commit 52a5f9eb8881a2c976a2b84ff683d8c11238efca Author: ddekany Date: 2017-07-30T00:04:56Z FREEMARKER-63: Removed TemplateTransformModel and the old TemplateDirectiveModel, renamed TemplateDirectiveModel2 to TemplateDirectiveModel. Removed the temporary `<~...>` syntax; now `<@...>` is used to call the new TemplateDirectiveModel. Lot of API refinement, like introduced ArgumentArrayLayout class. Several test cases won't yet pass... work in progress. commit 126c506984ea1e006b719ebb3ae92a4207c4c9f2 Author: ddekany Date: 2017-07-30T13:57:46Z FREEMARKER-63: Fixed failing test. (Now the test suite passes.) commit 589d9b80e218a39d2ac128b1108952992868cc40 Author: ddekany Date: 2017-07-30T18:38:01Z FREEMARKER-63: Change 1: Replaced the "loop variable" term with the more generic "nested content parameter" term. (In FM2, loop variables were introduced earlier than nested content parameter, so the two term coulnd't be unified. So it's just one less term in FM3.) Change 2: CallPlace.executeNestedContent now requires the nested content paramter value array to have exactly the same length as the number of parameters declared by the caller. commit 5bd19adeb8dd24cde34987c4724c7a5d5d227f52 Author: ddekany Date: 2017-07-30T21:07:29Z FREEMARKER-63: Added isNestedContentSupported() to templateDirectiveModel commit da4c33292d5d73cdfb53613ca64bd0834fcfb5fd Author: ddekany Date: 2017-07-30T21:20:34Z FREEMARKER-63: Removed NestedContentNotSupportedException, as TemplateDirectiveModel.isNestedContentSupported() now takes care of that problem. commit 3cacd9ed04a231af67e3964525fd592b97da1665 Author: ddekany Date: 2017-08-03T21:11:57Z FREEMARKER-63: Lot of refinement in the API-s and implementation. #macro now creates a `TemplateDirectiveModel`, and #function now creates `TemplateFunctionModel` (though the function/method call syntax doesn't yet allow named parameters). Test suite passes. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---