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::RenamePackage(3pm) User Contributed Perl Documentation PPIx::EditorTools::RenamePackage(3pm)NAME
PPIx::EditorTools::RenamePackage - Change the package name
SYNOPSIS
my $munged = PPIx::EditorTools::RenamePackage->new->rename(
code => "package TestPackage;
use strict;
BEGIN {
$^W = 1;
}
1;
",
replacement => 'NewPackage'
);
my $new_code_as_string = $munged->code;
my $package_ppi_element = $munged->element;
DESCRIPTION
This module uses PPI to change the package name of code.
METHODS
new()
Constructor. Generally shouldn't be called with any arguments.
rename( ppi => PPI::Document $ppi, replacement => Str ) =item rename( code => Str $code, replacement => Str )
Accepts either a "PPI::Document" to process or a string containing the code (which will be converted into a "PPI::Document") to
process. Replaces the package name 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.
Croaks with a "package name not found" exception if unable to find the package name.
SEE ALSO
This class inherits from "PPIx::EditorTools". Also see App::EditorTools, Padre, and PPI.
perl v5.14.2 2012-03-11 PPIx::EditorTools::RenamePackage(3pm)
I am trying to run the code below however I am getting a "syntax error near unexpected token `for file in error" on the line that is in red. I have the semicolons after every line because it will fail on the copy if I don't have them saying that it cannot stat directory. Is there something that I... (3 Replies)
Hi,
I'm using Linux through F-Secure. The VI editor I use doesnt support the syntax highlighter. Is there any way to invoke it?
Thanks in advance
Ananth (2 Replies)
Hi,
I need to find the "n/a" value presented row no. in my file i have following code but it gives all the row no. even i tried removing n/a by blank value and try to find the blank value it also failed.
awk -F\\t '{ if (NR == 1) { for (i=1;i<=NF;i++){if ($i==$3) { c=i } } };if (NR != 1) { if... (3 Replies)
Sooner than later I will render forum discussions in Vue.js to complement the standard way of showing forum threads.
Today, I ran across this component, vue-code-highlight
Beautiful code syntax highlighting as Vue.js component.
https://www.unix.com/members/1-albums225-picture1199.jpg
... (1 Reply)