summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2019-08-27 23:10:53 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2019-08-27 23:10:53 +0300
commit3c83bbc82caed02633492928900a480dedcbdd10 (patch)
tree331f3d5ee19ba7f355c6e6c117db975de03264d7
parent7f5328d5fb10150738924c527705389c2b2def51 (diff)
downloadconfig-ast-3c83bbc82caed02633492928900a480dedcbdd10.tar.gz
config-ast-3c83bbc82caed02633492928900a480dedcbdd10.tar.bz2
Provide overloads for the Follow class
* lib/Config/AST/Follow.pm: Provide overloads
-rw-r--r--lib/Config/AST/Follow.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Config/AST/Follow.pm b/lib/Config/AST/Follow.pm
index 84d6a3d..4d996a5 100644
--- a/lib/Config/AST/Follow.pm
+++ b/lib/Config/AST/Follow.pm
@@ -118,7 +118,16 @@ sub AUTOLOAD {
$self->{_lex} = $lex;
$self;
}
sub DESTROY { }
+use overload
+ bool => sub { !!shift->{_node} },
+ '""' => sub { shift->{_node}->as_string },
+ eq => sub {
+ my ($self,$other) = @_;
+ return $self->{_node}->as_string eq $other
+ };
+
+
1;

Return to:

Send suggestions and report system problems to the System administrator.