Permalink
Browse files

More flexible "_" function

  • Loading branch information...
1 parent 9aa03d7 commit 8411bacda01e1928c554bf44ad49bd3a370cf0ed @evanmiller evanmiller committed Jun 27, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/erlydtl_parser.yrl
View
@@ -237,6 +237,7 @@ Elements -> Elements WithBlock : '$1' ++ ['$2'].
ValueBraced -> open_var Value close_var : '$2'.
Value -> Value '|' Filter : {apply_filter, '$1', '$3'}.
+Value -> '_' '(' Value ')' : {trans, '$3'}.
Value -> Variable : '$1'.
Value -> Literal : '$1'.
@@ -373,7 +374,6 @@ Filter -> identifier : ['$1'].
Filter -> identifier ':' Literal : ['$1', '$3'].
Filter -> identifier ':' Variable : ['$1', '$3'].
-Literal -> '_' '(' string_literal ')' : {trans, '$3'}.
Literal -> string_literal : '$1'.
Literal -> number_literal : '$1'.

4 comments on commit 8411bac

Hi Evan,

I'm getting compilation errors:

                           [{{6,119},
                             erlydtl_parser,
                             ["syntax error before: ",
                              ["classroom_errors"]]}]}}},

on a a custom_tag using the _() trans with a var:

 error=_(classroom_errors.name)

Hi again,

My mistake, on a clean install works. I will send you a pull request to include this on ChicagoBoss/rebar.config

Thanks!

Contributor

evanmiller replied Jul 3, 2012

Thanks for verifying.

Contributor

evanmiller replied Jul 3, 2012

Went ahead and updated CB:

ChicagoBoss/ChicagoBoss@f2c3c6f

Please sign in to comment.