Budgie Expression language

Budgie implements a simple expression language for use in templating tags. It is primarily intended to dig down into nested data structures. It will later be extended to include simple arithmetics, but this is not done yet.

Accessing Template Parameters

Valid names for template parameters follow the same rules as in most programming languages: Alphanumeric, starting with a letter.

The following examples use the templating syntax of Budgie::Interpolator.

        Hello ${foo}
        Whitespace is trimmed: ${    bar }

Literal Values

Numeric literals can be used, as well as string literals enclosed in single quotes.

        1+2 = ${3}
        Hello ${'World'}

It makes more sense to use literals as array indices or hash keys than to just print them.

Arrays, hashes and other containers

The syntax to access elements is inspired by the bracket notation of Parrot's IMC language:

        Hello ${foo[1]} 
        Hello ${foo['one']}
        Hello ${foo[bar]}

This can go several levels deep:

        Hello ${foo[bar][baz]}