summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2019-08-27 20:10:53 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2019-08-27 20:10:53 (GMT)
commit3c83bbc82caed02633492928900a480dedcbdd10 (patch) (side-by-side diff)
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
Diffstat (more/less context) (ignore whitespace changes)
-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
@@ -121,4 +121,13 @@ sub AUTOLOAD {
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.