Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ppix::editortools::lexer(3pm) [debian man page]

PPIx::EditorTools::Lexer(3pm)				User Contributed Perl Documentation			     PPIx::EditorTools::Lexer(3pm)

NAME
PPIx::EditorTools::Lexer - Simple Lexer used for syntax highlighting SYNOPSIS
PPIx::EditorTools::Lexer->new->lexer( code => "package TestPackage; sub x { 1; ", highlighter => sub { my ( $css, $row, $rowchar, $len ) = @_; ... }, ); DESCRIPTION
Go over the various interesting elements of a give piece of code or an already process PPI tree. For each token call the user supplied 'highlighter' function with the follow values: $css - The keyword that can be used for colouring. $row - The row number where the token starts $rowchar - The character within that row where the token starts $len - The length of the token METHODS
new() Constructor. Generally shouldn't be called with any arguments. find( ppi => PPI::Document $ppi, highlighter => sub {...} ) =item find( code => Str $code, highlighter => sub ...{} ) Accepts either a "PPI::Document" to process or a string containing the code (which will be converted into a "PPI::Document") to process. Return a reference to an array. SEE ALSO
This class inherits from "PPIx::EditorTools". Also see App::EditorTools, Padre, and PPI. perl v5.14.2 2012-03-11 PPIx::EditorTools::Lexer(3pm)

Check Out this Related Man Page

PPIx::EditorTools::RenameVariable(3pm)			User Contributed Perl Documentation		    PPIx::EditorTools::RenameVariable(3pm)

NAME
PPIx::EditorTools::RenameVariable - Lexically replace a variable name in Perl code SYNOPSIS
my $munged = PPIx::EditorTools::RenameVariable->new->rename( code => $code, line => 15, column => 13, replacement => 'stuff', ); my $code_as_strig = $munged->code; my $code_as_ppi = $munged->ppi; my $location = $munged->element->location; DESCRIPTION
This module will lexically replace a variable name. METHODS
new() Constructor. Generally shouldn't be called with any arguments. rename( ppi => PPI::Document $ppi, line => Int, column => Int, replacement => Str ) =item rename( code => Str $code, line => Int, column => Int, replacement => Str ) =item rename( code => Str $code, line => Int, column => Int, to_camel_case => Bool, [ucfirst => Bool] ) =item rename( code => Str $code, line => Int, column => Int, from_camel_case => Bool, [ucfirst => Bool] ) Accepts either a "PPI::Document" to process or a string containing the code (which will be converted into a "PPI::Document") to process. Renames the variable found at line, column with that supplied in the "replacement" parameter and returns a "PPIx::EditorTools::ReturnObject" with the new code available via the "ppi" or "code" accessors, as a "PPI::Document" or "string", respectively. The "PPI::Token" found at line, column is available via the "element" accessor. Instead of specifying an explicit replacement variable name, you may choose to use the "to_camel_case" or "from_camel_case" options that automatically convert to/from camelCase. In that mode, the "ucfirst" option will force uppercasing of the first letter. You can not specify a replacement name and use the "to/from_camel_case" options. Croaks with a "no token" exception if no token is found at the location. Croaks with a "no declaration" exception if unable to find the declaration. SEE ALSO
This class inherits from "PPIx::EditorTools". Also see App::EditorTools, Padre, and PPI. perl v5.14.2 2012-03-11 PPIx::EditorTools::RenameVariable(3pm)
Man Page