Changeset 2155
- Timestamp:
- 12/22/08 00:51:36 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre-Plugin-Perl6/lib/Padre/Document/Perl6.pm
r2154 r2155 15 15 16 16 my $keywords; 17 my $issues = []; 17 18 18 19 # Naive way to parse and colorize perl6 files … … 31 32 eval { @tokens = $p->tokens; 1; }; 32 33 if($EVAL_ERROR) { 33 say "Parsing error, bye bye ->colorize"; 34 say "Parsing error, bye bye ->colorize " . $EVAL_ERROR; 35 my @errors = split /\n/, $EVAL_ERROR; 36 my $lineno = -1; 37 my $error_msg = ""; 38 for my $error (@errors) { 39 if($error =~ /error.+line (\d+)/) { 40 $lineno = $1; 41 $error_msg = $error; 42 } 43 } 44 # update errors 45 $issues = [ { line => $lineno, msg => $error_msg, severity => 'E', desc => $EVAL_ERROR, } ]; 34 46 return; 47 } else { 48 # no errors... 49 $issues = []; 35 50 } 36 51 … … 98 113 } 99 114 115 sub check_syntax { 116 my $self = shift; 117 return $self->_check_syntax_internal; 118 } 119 120 sub check_syntax_in_background { 121 my $self = shift; 122 return $self->_check_syntax_internal; 123 } 124 125 sub _check_syntax_internal { 126 my $self = shift; 127 return $issues; 128 } 129 100 130 sub keywords { 101 131 if (! defined $keywords) {
Note: See TracChangeset
for help on using the changeset viewer.
