| Padre-Plugin-Perl6 documentation | Contained in the Padre-Plugin-Perl6 distribution. |
Padre::Plugin::Perl6::Syntax - Perl document background syntax-checker
version 0.71
require Padre::Plugin::Perl6::Syntax; my $task = Padre::Plugin::Perl6::Syntax->new( document => $self, ); $task->schedule;
This class implements syntax checking of Perl documents in the background. It inherits from Padre::Task::SyntaxChecker. Please read its documentation!
This class inherits from Padre::Task and its instances can be scheduled using Padre::TaskManager.
The transfer of the objects to and from the worker threads is implemented with Storable.
This software is copyright (c) 2010 by Ahmad M. Zawawi.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| Padre-Plugin-Perl6 documentation | Contained in the Padre-Plugin-Perl6 distribution. |
package Padre::Plugin::Perl6::Syntax; BEGIN { $Padre::Plugin::Perl6::Syntax::VERSION = '0.71'; } # ABSTRACT: Perl document background syntax-checker use 5.010; use strict; use warnings; use Carp (); use Params::Util (); use Padre::Task (); our @ISA = 'Padre::Task'; sub new { my $self = shift->SUPER::new(@_); # Just convert the document to text for now. # Later, we'll suck in more data from the project and # other related documents to do syntax checks more awesomely. unless ( Params::Util::_INSTANCE( $self->{document}, 'Padre::Document' ) ) { die "Failed to provide a document to the syntax check task"; } # Remove the document entirely as we do this, # as it won't be able to survive serialisation. my $document = delete $self->{document}; # Clone issues my $cloned_issues = []; if ( $document->{issues} ) { my @issues = @{ $document->{issues} }; foreach (@issues) { my %cloned_issue = %$_; push @{$cloned_issues}, \%cloned_issue; } } $self->{issues} = $cloned_issues; return $self; } sub run { my $self = shift; $self->{model} = delete $self->{issues}; return 1; } 1;
__END__