mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
Refactor handling of --version flags; add --analyze
Move handling of certain language-specific flags out of compiler_vm_server.pl and into their own language modules. Add support for clang --analyze. Java now understands -version.
This commit is contained in:
parent
ab39220fd5
commit
03baaeb81c
@ -126,13 +126,7 @@ sub interpret {
|
|||||||
|
|
||||||
$mod->preprocess;
|
$mod->preprocess;
|
||||||
|
|
||||||
if($cmdline =~ m/-?-version/) {
|
$mod->postprocess if not $mod->{error} and not $mod->{done};
|
||||||
# cmdline contained version request, so don't postprocess and just return the version output
|
|
||||||
$mod->{output} =~ s/\s+\(Ubuntu.*-\d+ubuntu\d+\)//;
|
|
||||||
return $mod->{output};
|
|
||||||
}
|
|
||||||
|
|
||||||
$mod->postprocess if not $mod->{error};
|
|
||||||
|
|
||||||
if (exists $mod->{no_output} or not length $mod->{output}) {
|
if (exists $mod->{no_output} or not length $mod->{output}) {
|
||||||
$mod->{output} .= "\n" if length $mod->{output};
|
$mod->{output} .= "\n" if length $mod->{output};
|
||||||
|
@ -6,6 +6,15 @@ use strict;
|
|||||||
package _c_base;
|
package _c_base;
|
||||||
use parent '_default';
|
use parent '_default';
|
||||||
|
|
||||||
|
sub preprocess {
|
||||||
|
my $self = shift;
|
||||||
|
$self->SUPER::preprocess;
|
||||||
|
|
||||||
|
if ($self->{cmdline} =~ m/--(?:version|analyze)/) {
|
||||||
|
$self->{done} = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub postprocess {
|
sub postprocess {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
@ -6,6 +6,15 @@ use strict;
|
|||||||
package java;
|
package java;
|
||||||
use parent '_default';
|
use parent '_default';
|
||||||
|
|
||||||
|
sub preprocess {
|
||||||
|
my $self = shift;
|
||||||
|
$self->SUPER::preprocess;
|
||||||
|
|
||||||
|
if ($self->{cmdline} =~ m/-version/) {
|
||||||
|
$self->{done} = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub postprocess {
|
sub postprocess {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user