Permalink
Browse files

Merge pull request #6 from vladimir-vg/ampersand-syntax

Add ampersand syntax ({{&content}}) for unescaped content.
  • Loading branch information...
2 parents 8de52f9 + d071e28 commit 27007aca5b1fb04496af6ac631e8e9804fadbd4b @devinus committed May 9, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −0 src/walrus_lexer.xrl
  2. +2 −1 src/walrus_parser.yrl
View
@@ -11,6 +11,7 @@ Rules.
{{/ : {token,{'{{/',TokenLine}}.
{{\^ : {token,{'{{^',TokenLine}}.
{{{ : {token,{'{{{',TokenLine}}.
+{{& : {token,{'{{&',TokenLine}}.
\s*{Key}\s*}} : {token,{key,TokenLine,?key(TokenChars,TokenLen)},"}}"}.
}} : {token,{'}}',TokenLine}}.
}}} : {token,{'}}}',TokenLine}}.
View
@@ -1,6 +1,6 @@
Nonterminals template token var block inverse.
-Terminals text key '{{' '{{{' '{{#' '{{/' '{{^' '}}' '}}}'.
+Terminals text key '{{' '{{{' '{{&' '{{#' '{{/' '{{^' '}}' '}}}'.
Rootsymbol template.
@@ -14,6 +14,7 @@ token -> inverse : '$1'.
var -> '{{' key '}}' : {var, ?value('$2')}.
var -> '{{{' key '}}}' : {var_unescaped, ?value('$2')}.
+var -> '{{&' key '}}' : {var_unescaped, ?value('$2')}.
block -> '{{#' key '}}' template '{{/' key '}}'
: section(block, '$2', '$6', '$4').

0 comments on commit 27007ac

Please sign in to comment.