diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-08-27 23:10:53 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-08-27 23:10:53 +0300 |
commit | 3c83bbc82caed02633492928900a480dedcbdd10 (patch) | |
tree | 331f3d5ee19ba7f355c6e6c117db975de03264d7 | |
parent | 7f5328d5fb10150738924c527705389c2b2def51 (diff) | |
download | config-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.pm | 9 |
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 { | |||
121 | 121 | ||
122 | sub DESTROY { } | 122 | sub DESTROY { } |
123 | 123 | ||
124 | use overload | ||
125 | bool => sub { !!shift->{_node} }, | ||
126 | '""' => sub { shift->{_node}->as_string }, | ||
127 | eq => sub { | ||
128 | my ($self,$other) = @_; | ||
129 | return $self->{_node}->as_string eq $other | ||
130 | }; | ||
131 | |||
132 | |||
124 | 1; | 133 | 1; |