Daniel Dekany created FREEMARKER-99:
---------------------------------------

             Summary: FM3 More uniform, dialect based directive call syntax
                 Key: FREEMARKER-99
                 URL: https://issues.apache.org/jira/browse/FREEMARKER-99
             Project: Apache Freemarker
          Issue Type: New Feature
            Reporter: Daniel Dekany


In FM2, the directive call syntax of "built-in directives", like {{#if}}, 
{{#list}}, etc. is hardcoded into the JavaCC parser source code ({{FTL.jj}}), 
allowing each to have its own special syntax. In FM3, the syntax of these 
directives will be similar to the syntax of dynamic calls, like {{<@foo 1, 2 
x=2, y=2>}}. FM2 has things like {{<#import "foo.ftl" as f>}}, which should 
then become to {{<#import f ="foo.ftl">}}, which is more consistent with the 
dynamic call syntax.

The parser has to be changed so that it's not aware of what core directives 
exist, instead it parses tags with a common logic, and then look up the rules 
of the actual directive (like what parameters are supported, can it have nested 
content, etc.) in a {{Dialect}}. This ensures that the syntax of the directive 
calls are consistent.

Another long term goal is to allow users can define their own dialects. Parts 
of the API-s needed for that will be already implemented as part of this issue, 
as the default dialect should be implemented as a {{Dialect}} as well. (The API 
most certainly won't be public for now though, and the full user dialects 
feature will be a separate issue.)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to