Class PageTemplate::SyntaxGlossary
In: lib/PageTemplate/parser.rb
Parent: Object

This is the dictionary of commands and the directive that Parser uses to compile a template into a tree of commands.

directive is the general format of a PageTemplate command. Default: /\[%(.+?)%\]/m

@glossary is a hash table of regexp->Command objects. These regexps should not contain PageTemplate command text. i.e: /var \w+/i should be used instead of /[% var %]/

Methods

Attributes

default  [W] 
directive  [RW] 

Public Class methods

Define a regexp -> Command mapping. rx is inserted in the lookup table as a key for command

This is shorthand for define(key,Valuecommand), and also allows key to be a string, converting it to a regexp before adding it to the dictionary.

Look up command to see if it matches a command within the lookup table, returning the instance of the command for it, or an UnknownCommand if none match.

[Validate]