summaryrefslogtreecommitdiffabout
AgeCommit message (Collapse)AuthorFiles
2019-08-28Version 1.05HEADv1.05masterSergey Poznyakoff2
2019-08-28Add new testcaseSergey Poznyakoff1
2019-08-28Re-implement case-insensitive lookupsSergey Poznyakoff10
* lib/Config/AST.pm (new): Use the lexicon method to store the new lexicon. Create the root node. (root,mangle_key): New method. (lexicon): Deep-copy the passed lexicon and preprocess its keys using the _clone_lexicon method. (_clone_lexicon): Auxiliary method for lexicon. (describe_keyword): New method. (all methods): Pass the "$self" argument to the Config::AST::Node::Section constructor calls. (add_node): Preprocess key names using mangle_key. (DESTROY): Destroy the tree to break circular references. * lib/Config/AST/Root.pm: New file. * lib/Config/AST/Node/Section.pm (new): First argument is mandatory: a reference to the root node or the owning Config::AST object. (is_leaf,is_section): Provide definitions. (root): New method. (subtree): Use root->mangle_key to prepare the lookup key. * lib/Config/AST/Node.pm (is_section): Return 0 * lib/Config/AST/Node/Value.pm: Likewise. * t/02conf01.t: The "root" name is now reserved and cannot be used in direct addressing. * t/02merge.t: Pass obligatory argument to the Config::AST::Node::Section constructor. * lib/Config/AST/Follow.pm: Use L<> for cross-references. * lib/Config/AST/Node/Null.pm: Likewise.
2019-08-27Provide overloads for the Follow classSergey Poznyakoff1
* lib/Config/AST/Follow.pm: Provide overloads
2019-08-27Version 1.04v1.04Sergey Poznyakoff2
2019-08-27Two auxiliary methodsSergey Poznyakoff1
* lib/Config/AST.pm (error_count,success): New methods.
2019-08-27Declare DESTROY in Null (follow-up to 058e552b)Sergey Poznyakoff1
* lib/Config/AST/Node/Null.pm (DESTROY): Add method.
2019-08-27Improve commit / lint APISergey Poznyakoff1
* lib/Config/AST.pm (commit): Take optional keyword arguments. (lint): The argument (reference to a lexicon) is optional.
2019-08-27Provide DESTROY method along with AUTOLOADv1.03Sergey Poznyakoff3
2019-08-23Version 1.02v1.02Sergey Poznyakoff7
2019-08-23Rewrite direct access engineSergey Poznyakoff6
This changes the syntax of direct addressing. To access the node a.b.c, one can simply write $cfg->a->b->c Node names cannot coincide with existing method names, as the latter will take precedence. * lib/Config/AST.pm (AUTOLOAD): Bootstrap direct addressing mechanism. * lib/Config/AST/Follow.pm: New module. * lib/Config/AST/Node/Section.pm (AUTOLOAD): Remove. * t/01conf12.t: Use new direct addressing syntax. * t/02conf01.t: Likewise. * lib/Config/AST/Node/Value.pm: Use fallback instead of explicitly overloading particular operators.
2019-08-22Overload operators for Value and Null classesSergey Poznyakoff9
* lib/Config/AST/Node/Null.pm: Rewrite overloads. * lib/Config/AST/Node/Value.pm: Likewise. * t/03ovr.t: New test. * t/01conf06.t: Remove unused dependencies. * t/01conf07.t: Likewise. * t/01conf13.t: Likewise. * t/01conf14.t: Likewise. * t/02conf01.t: Likewise. * t/02merge.t: Likewise.
2019-08-20Fix repository URLv1.01Sergey Poznyakoff3
2019-08-20Version 1.0v1.00Sergey Poznyakoff5
* Changes: New file. * LICENSE: New file. * README: New file. * lib/Config/AST.pm: Update docs.
2019-08-20Minor fixSergey Poznyakoff1
* lib/Config/AST.pm: Fix the misguiding documentation
2019-08-19New method: lexicon.Sergey Poznyakoff1
2018-07-10Write PODSergey Poznyakoff7
2018-07-10Rename to Config::ASTSergey Poznyakoff19
2018-07-09Switch to Text::Locus instead of the local versionSergey Poznyakoff10
* lib/Config/Tree/Locus.pm: Remove. * t/00locus.t: Remove. * Makefile.PL: Require Text::Locus * lib/Config/Tree.pm: Use Text::Locus * lib/Config/Tree/Node.pm: Likewise. * lib/Config/Tree/Node/Null.pm: Likewise. * lib/Config/Tree/Node/Section.pm: Likewise. * t/01conf10.t: Likewise. * t/02merge.t: Likewise. * t/TestConfig.pm: Likewise.
2018-05-05Rewrite the value method of Node::Value.Sergey Poznyakoff6
* lib/Config/Tree.pm (get): Simplify. Context dependency moved to Value. (canonical): New method. * lib/Config/Tree/Node.pm (canonical): New method. * lib/Config/Tree/Node/Value.pm (value): In list context, return dereferenced value (if appropriate). * t/02merge.t: Use the canonical method. * t/TestConfig.pm (canonical): Rewrite using method from the superclass.
2018-05-04BugfixSergey Poznyakoff1
* lib/Config/Tree.pm (add_node): untaint always returns undef
2018-05-04Implement as_hash in Config::Tree::Node::SectionSergey Poznyakoff3
* lib/Config/Tree.pm (add_node): Untaint values that matched re or passed the check function. (as_hash): Delegate to tree->as_hash * lib/Config/Tree/Node/Section.pm (as_hash): New method. * t/01conf12.t: Test Section::as_hash.
2018-05-04Implement "direct addressing"Sergey Poznyakoff6
An experimental feature that allows the programmer to access configuration settings as if they were methods of the configuration class. E.g. the following setting .foo.bar.baz: 45 can be accessed as $cfg->tree->Foo->Bar->Baz (Keyword names are capitalized to help distinguish them from the regular methods. Also a dash in the setting name should be represented as __ when using it as a method. Thus 'temp-dir' would become Temp__dir). * lib/Config/Tree.pm (subtree): New method. * lib/Config/Tree/Node.pm (is_leaf, is_null): New methods. Overload bool, eq, and "". * lib/Config/Tree/Node/Null.pm: New module. * lib/Config/Tree/Node/Section.pm: Implement AUTOLOAD for accessing settings as methods. * lib/Config/Tree/Node/Value.pm: Implement as_string.
2018-01-22Improve error checkingSergey Poznyakoff20
* lib/Config/Tree.pm: Use add_locus for location aggregation. (add_node): Catch uses of values where sections are expected. * lib/Config/Tree/Node.pm (locus): Create empty locus if none was set explicitly. * lib/Config/Tree/Node/Section.pm (merge): New method. * t/01conf15.t: New testcase. * t/02merge.t: New testcase. * t/*.t: Reorder tests.
2018-01-20Add more filesSergey Poznyakoff3
2018-01-20Catch more errors.Sergey Poznyakoff5
Detect undefined mandatory sections declared via intermediate wildcards (e.g. load.*.param). * lib/Config/Tree.pm (error): Change the check for locus. (_fixup): catch more errors. (flatten): Rewrite via Node->flatten. * lib/Config/Tree/Node.pm (flatten): New method. * t/TestConfig.pm: Minor fix. * t/conf13.t: New testcase. * t/conf14.t: New testcase.
2018-01-17Implement as_hash method. Assorted fixes.Sergey Poznyakoff5
2017-12-03Implement add_node and add_value methodsSergey Poznyakoff3
2017-12-03Initial commitSergey Poznyakoff19

Return to:

Send suggestions and report system problems to the System administrator.