summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2019-08-27 13:43:29 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2019-08-27 13:43:29 (GMT)
commit9a94fbc91ce1c2cfeffc8a8cb0e874e31d9d6ecb (patch) (side-by-side diff)
tree9ed66f7b4abb728808f861217f27de128317875c
parent915b6221ebbab067493e2f7bb73978f400209f09 (diff)
downloadconfig-ast-9a94fbc91ce1c2cfeffc8a8cb0e874e31d9d6ecb.tar.gz
config-ast-9a94fbc91ce1c2cfeffc8a8cb0e874e31d9d6ecb.tar.bz2
Two auxiliary methods
* lib/Config/AST.pm (error_count,success): New methods.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/Config/AST.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Config/AST.pm b/lib/Config/AST.pm
index fb10569..275e902 100644
--- a/lib/Config/AST.pm
+++ b/lib/Config/AST.pm
@@ -415,6 +415,27 @@ sub commit {
return $self->{_error_count} == 0;
}
+=head2 $cfg->error_count
+
+Returns total number of errors encountered during parsing.
+
+=cut
+
+sub error_count { shift->{_error_count} }
+
+=head2 $cfg->success
+
+Returns true if no errors were detected during parsing.
+
+=cut
+
+sub success { ! shift->error_count }
+
+# Auxiliary function used in commit and lint.
+# Arguments:
+# $section - A Config::AST::Node::Section to start fixup at
+# $params - Lexicon.
+# @path - Path to $section
sub fixup_tree {
my ($self, $section, $params, @path) = @_;

Return to:

Send suggestions and report system problems to the System administrator.