Luminous  git-master
 All Classes Files Functions Variables
Static Public Member Functions | Static Private Member Functions | List of all members
LuminousFilters Class Reference

A collection of useful common filters. More...

Static Public Member Functions

static clean_ident ($token)
 Translates anything of type 'IDENT' to the null type.
static comment_note ($token)
 Highlights comment notes Highlights keywords in comments, i.e. "NOTE", "XXX", "FIXME", "TODO", "HACK", "BUG".
static doxygenize ($token)
 Highlights doc-comment tags inside a comment block.
static generic_doc_comment ($token)
 Generic filter to highlight JavaDoc, PHPDoc, Doxygen, JSdoc, and similar doc comment syntax.
static oo_stream_filter ($tokens)
 Attempts to apply OO syntax highlighting.
static pcre ($token, $delimited=true)
 Tries to highlight PCRE style regular expression syntax.
static string ($token)
 Highlights generic escape sequences in strings Highlights escape sequences in strings. There is no checking on which sequences are legal, this is simply a generic function which checks for \u... unicode, \d... octal, \x... hex and finally just any character following a backslash.
static upper_to_constant ($token)
 Translates any token type of an uppercase/numeric IDENT to 'CONSTANT'.

Static Private Member Functions

static doxygen_arg_length ($command)
 Gets the expected number of arguments to a doc-comment command/tag.
static doxygenize_cb ($matches)
 callback to doxygenize Highlights Doxygen-esque doc-comment syntax. This is a callback to doxygenize().

Detailed Description

A collection of useful common filters.

Filters are either stream filters or individual filters. Stream filters operate on the entire token stream, and return the new token stream. Individual filters operate on individual tokens (bound by type), and return the new token. Any publicly available member here is one of those, therefore the return and param documents are omitted.

Member Function Documentation

static LuminousFilters::doxygen_arg_length (   $command)
staticprivate

Gets the expected number of arguments to a doc-comment command/tag.

Parameters
$commandthe name of the command
Returns
The expected number of arguments for a command, this is either 0 or 1 at the moment
static LuminousFilters::doxygenize (   $token)
static

Highlights doc-comment tags inside a comment block.

See Also
generic_doc_comment
static LuminousFilters::doxygenize_cb (   $matches)
staticprivate

callback to doxygenize Highlights Doxygen-esque doc-comment syntax. This is a callback to doxygenize().

Returns
the highlighted string
static LuminousFilters::generic_doc_comment (   $token)
static

Generic filter to highlight JavaDoc, PHPDoc, Doxygen, JSdoc, and similar doc comment syntax.

A cursory check will be performed to try to validate that the token really is a doc-comment, it does this by checking for common formats.

If the check is successful, the token will be switched to type 'DOCCOMMENT' and its doc-tags will be highlighted

This is a wrapper around doxygenize(). If the checks are not necessary, or incorrect for your situation, you may instead choose to use doxygenize() directly.

static LuminousFilters::oo_stream_filter (   $tokens)
static

Attempts to apply OO syntax highlighting.

Tries to apply generic OO syntax highlighting. Any identifer immediately preceding a '.', '::' or '->' token is mapped to an 'OO'. Any identifer token immediatel following any of those tokens is mapped to an 'OBJ'. This is a stream filter.


The documentation for this class was generated from the following file: