From: Uri Guttman Date: Wed, 9 May 2012 18:15:16 +0000 (-0400) Subject: changed token_id to token_re X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;hp=ba66415e78c8e83bb1c216678e27006006a7c22c;p=urisagit%2FTemplate-Simple.git changed token_id to token_re --- diff --git a/lib/Template/Simple.pm b/lib/Template/Simple.pm index 20d2a46..02bf39d 100644 --- a/lib/Template/Simple.pm +++ b/lib/Template/Simple.pm @@ -14,7 +14,7 @@ my %opt_defaults = ( pre_delim => qr/\[%/, post_delim => qr/%\]/, - token_id => qr/\w+?/, + token_re => qr/\w+?/, greedy_chunk => 0, # upper_case => 0, # lower_case => 0, @@ -49,7 +49,7 @@ sub new { $self->{scalar_re} = qr{ $self->{pre_delim} \s* # optional leading whitespace - ($self->{token_id}) # grab scalar name + ($self->{token_re}) # grab scalar name \s* # optional trailing whitespace $self->{post_delim} }xi ; # case insensitive @@ -67,7 +67,7 @@ sub new { \s* # optional leading whitespace START # required START token \s+ # required whitespace - ($self->{token_id}) # grab the chunk name + ($self->{token_re}) # grab the chunk name \s* # optional trailing whitespace $self->{post_delim} ($chunk_body) # grab the chunk body @@ -89,7 +89,7 @@ sub new { \s* # optional leading whitespace INCLUDE # required INCLUDE token \s+ # required whitespace - ($self->{token_id}) # grab the included template name + ($self->{token_re}) # grab the included template name \s* # optional trailing whitespace $self->{post_delim} }xi ; # case insensitive @@ -850,7 +850,7 @@ can have optional whitespace before and after it. A token is replaced by a value looked up in a hash with the token as the key. The hash lookup keeps the same case as parsed from the token markup. You can override the regular expression used to match a token with the -C option. +C option. [% foo %] [%BAR%] @@ -872,7 +872,7 @@ kept. Chunks are the primary way to markup templates for structures references) and callbacks to user code. By default a chunk will be a non-greedy grab but you can change that in the constructor by enabling the C option. You can override the regular expression -used to match the chunk name with the C option. +used to match the chunk name with the C option. [%Start FOO%] [% START bar %] @@ -885,7 +885,7 @@ used to match the chunk name with the C option. When a markup C<[%include name%]> is seen, that text is replaced by the template of that name. C is matched with C<\w+?> which is the name of the template. You can override the regular expression used -to match the include C with the C option. +to match the include C with the C option. See C for more on this.