3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-09 21:49:34 +01:00
pbot/applets/compiler_vm/host/lib/Diff.pm
Pragmatic Software 33e13fd993 Start refactoring virtual machine (1/3)
This is expected to take three commits to complete. This first initial
commit does the following:

- Begin initial rough-draft of doc/VirtualMachine.md
- Begin initial refactoring of scripts

The next commit will polish up the initial rough-draft and refactoring.

The final commit will quality-check everything and fix anything overlooked.
2022-01-23 07:49:23 -08:00

45 lines
831 B
Perl

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
package Diff;
use strict;
use HTML::Entities qw(encode_entities);
use vars qw($VERSION @ISA);
$VERSION = '0.08';
@ISA = qw(Text::WordDiff::Base);
sub new {
my ($class, %conf) = @_;
return bless \%conf, $class;
}
sub file_header {
my $header = shift->SUPER::file_header(@_);
return '' unless $header;
return $header;
}
sub hunk_header { return '' }
sub hunk_footer { return '' }
sub file_footer { return '' }
sub same_items {
shift;
return join '', @_;
}
sub delete_items {
shift;
return '<del>' . (join'', @_ ) . '</del>';
}
sub insert_items {
shift;
return '<ins>' . ( join'', @_ ) . '</ins>';
}
1;