Revision history for Data-Sah 0.22 2014-01-09 (SHARYANTO) - No functional changes. Add test, tweak logging in generated code. [BUG FIXES] - Prog: data path (dpath) prefix was not shown for error message in expression version (err_expr), e.g. for hash clause req_keys. - JS: Fix error message for req_keys clause. 0.21 2014-01-03 (SHARYANTO) [BUG FIXES] - perl: req_keys clause: Avoid clashing of variable '$_' when '$dt' happens to contain '$_' also (can happen e.g. with schema like [array => of => [hash => req_keys => ["a"]]]. 0.20 2013-11-25 (SHARYANTO) [ENHANCEMENTS] - Implement hash clause: 're_keys'. [BUG FIXES] - 'cistr' type: fix matching in perl >= 5.14.0 due to not yet handling (?^...:...) regex stringification form. [DOCUMENTATION] - Add Manual::Contributing. 0.19 2013-11-23 (SHARYANTO) [ENHANCEMENTS] - Implement types 'undef', 'cistr', 'buf'. - Implement clauses: 'ok', 'has'. - Implement hash clauses: req_keys (thanks Michal Sedlák), allowed_keys, allowed_keys_re, forbidden_keys, forbidden_keys_re. - Add modules: Data::Sah::JS, Data::Sah::Human. [ETC] - Adjust to Sah 0.9.29. [BUG FIXES] - Fix bug in generating human/error message for "between|". 0.18 2013-09-11 (SHARYANTO) - Add 'use experimental smartmatch' in generated code so that the generated code compiles cleanly on Perl 5.18+ [CT]. 0.17 2013-09-09 (SHARYANTO) - No functional changes. Add 'use experimental smartmatch' for Perl 5.18+ [CT]. 0.16 2013-08-11 (SHARYANTO) - Tweak docs. - Handle case when LANGUAGE/LANG is ''. 0.15 2013-03-11 (SHARYANTO) - No functional changes. Avoid perl undef warning in human compiler (e.g. when schema is [int => default => undef]). 0.14 2013-02-07 (SHARYANTO) - This is the first release that includes a working js compiler. Along with this release are some fixes and refactorings. 0.13 2013-01-18 (SHARYANTO) [ENHANCEMENTS] - Slightly tweak max/re clauses so the human can generate clauses in nicer order, e.g. "at least X, at most Y" instead of "at most Y, at least X" (since max is alphabetically smaller than min). [BUG FIXES] - Fallback to en_US if Data::Sah::Lang::$lang cannot be found [CT reports]. - Alphabetical sorting of clause names used wrong variables [CT report]. 0.12 2013-01-16 (SHARYANTO) - No functional changes. Add a human test. 0.11 2013-01-16 (SHARYANTO) - No functional changes. Minor fixes/adjustments [CT reports]. 0.10 2013-01-11 (SHARYANTO) - 0.09 was also broken, sorry. [ENHANCEMENTS] - Now follow Sah 0.9.23 spec (previously 0.9.19). - Basic human compiler now works, with English and Indonesian translation. The Perl compiler is now using error messages produced by the human compiler. Error message also now indicates data path, e.g. if there is an error in the second element of array data, it shows '@1'. - Line number when logging generated validator/schema code can be omitted by setting environment variable LINENUM=0. [INCOMPATIBLE CHANGES] - Rename compile option 'mark_fallback' to 'mark_missing_translation' to make it clearer. [REMOVED FEATURES] - Remove min [BUG FIXES] - Subcompilation now uses all options from parent (except those that need to be set/changed by the subcompilation). - Various fixes and refactorings. 0.09 2012-11-22 (SHARYANTO) - 0.08 was broken, sorry. [ENHANCEMENTS] - Add gen_validator() options: accept_ref and source. Unknown options are still passed to Perl schema compiler. - Add compile() option: skip_clause. - perl: Implement hash's keys, keys.restrict, keys.create_default. Implement array's elems, elems.create_default. [REFACTORING] - Split Data::Sah::Util{::Role,::TypeX} so each can stay slim. 0.08 2012-11-06 (SHARYANTO) [ENHANCEMENTS] - Add compile option: 'comment' (to allow stripping comment in generated code). - perl: Implement str's {match, is_re}, obj's {can, isa}. - Add a way to control logging of generated code via $Log_Validator_Code or LOG_SAH_VALIDATOR_CODE. 0.07 2012-11-01 (SHARYANTO) [INCOMPATIBLE CHANGES] - Remove module Data::Sah::Simple (IMO Data::Sah is not large enough to warrant a 'simple' variant). Data::Sah now can export 'normalize_schema' as well as 'gen_validator'. - Rename compile option 'validator_return_type' to 'return_type' (Huffman encoding). [REMOVED FEATURES] - Remove compile(), perl(), human(), js() to make things more orthogonal. They are just shortcuts, and I reckon they will not be used relatively often. 0.06 2012-10-26 (SHARYANTO) - Follow latest Sah spec (0.9.16). - perl: Handle more types and clauses: array's 'of', str (incomplete), hash (incomplete), bool (incomplete), any, all. Data::Sah can now handle compilation of schemas from Perinci-Sub-Wrapper and Perinci-Examples! Finally, it's starting to be usable (happy face). - Some refactoring (rename modules). 0.05 2012-10-25 (SHARYANTO) - Split spec to Sah. To follow spec changes, see Sah's Changes. - Many changes following latest Sah spec (0.9.15). - Simplify compiler interface a bit: no longer accept multiple input. However, result is now a data structure ('$cd') instead of string, for more flexibility. - Generating Perl validator now works for simple schemas, like "int", ["array*", {min_len=>1, max_len=>10}]. There are still many types and clauses not yet implemented (currently only "int", "float", and "array" types are supported; more will be coming soon). - Add module Data::Sah::Simple. - Add compile() option: on_unhandled_{clause,attr}. 0.04 2012-07-20 (SHARYANTO) - No functional changes. Rebuild because dzil still included files in lib-disabled/. 0.03 2012-07-20 (SHARYANTO) - Mostly spec changes (syntax changes, lots of removed clauses to be more orthogonal). Implementation is still grossly incomplete. - (spec) New clause 'cset' to contain a clause set inside a clause. This provides a more elegant way to nest clauses, with possibly complex relationships (combine with {max,min}_{ok,nok} attributes). - [INCOMPATIBLE] (spec) Remove {max,min}_{ok,nok} *clauses*. They are now purely attributes. To apply to a set of clauses, apply to the new 'cset' clause. - [INCOMPATIBLE] (spec) Rename 'value' and 'values' attribute to 'val'/'vals'. (Huffman principle) - [INCOMPATIBLE] (spec) Remove 'CLAUSENAME.*' syntax, it's ugly. - [INCOMPATIBLE] (spec) Change 'if' clause syntax: [if, expr, EXPR, cset, CSET]. Might probably change again :-) - [INCOMPATIBLE] (spec) Change merge prefix syntax from [merge:OP] to [mergeOP], e.g. [merge+]. (Huffman principle) - [INCOMPATIBLE] (spec) Remove unnecessary 'str' clauses: match_all, match_any, not_match, match_none (they can be replaced with the more generic clause sttributes 'values' and {min,max}_{ok,nok}) - [INCOMPATIBLE] (spec) Remove unnecessary 'int' clauses: indiv_by (can be replaced with the more generic clause attributes 'values' and {min,max}_{ok,nok}) - [INCOMPATIBLE] (spec) Remove unnecessary 'HasElems' clauses: has_all, has_any, has_none (can be replaced with the more generic clause attributes 'values' and {min,max}_{ok,nok}) - [INCOMPATIBLE] (spec) Remove unnecessary 'Comparable' clauses: isnt, not_in (can be replaced with the more generic clause attributes 'values' and {min,max}_{ok,nok}) - [INCOMPATIBLE] (spec) Remove .revert attribute, use .max_ok instead - '.attr' clause is now allowed again. - (spec) New attribute: default_lang (like in Rinci) - Remove warning under Perl 5.16 [RT#78491] 0.02 2012-01-27 (SHARYANTO) - Mostly spec changes (some major, backward-incompatible). Implementation still minimal/incomplete. - [INCOMPATIBLE] No more hash form! Now schema is either string or array. I've always hated writing the hash form and 99% always used the array form. Hash form can be re-added in the future in the unlikely event that we need it. - [INCOMPATIBLE] Array form now only allows one clause sets. To specify multiple clause sets, now there is a new clause named 'csets'. This is an application of Huffman encoding principle, as specifying multiple clause sets is relatively rare. The third element of array now can be used for other purposes, it is now an optional hash to store future extra stuffs. - [INCOMPATIBLE] Change merge prefixes, from the default provided by Data::ModeMerge (!, +, -, ^, et al) to the more verbose ([merge], [merge:+], [merge:!], and so on). This is also an application of Huffman encoding principle, since merging is relatively rare. The !, etc prefixes are going to be reused for other purposes. For example, !clause now means setting the .max_ok attribute to 0. - [INCOMPATIBLE] Change syntax of attribute, from 'CLAUSE:ATTR' and ':ATTR' to 'CLAUSE.ATTR' and '.ATTR'. Using dot is nicer and now possible as the first character since we have changed merge prefixes. - Introduce shortcuts - [INCOMPATIBLE] String shortcuts are cut back. Now only 'foo*' is supported, to mean [foo => {req=>1}]. I find that this is the only shortcut that is commonly used, the rest not so much. Limiting the shortcuts feature allows simplifying the schema for Sah itself (no grammar needed, only a single regex needed to validate). - [INCOMPATIBLE] Sortable types: rename clause {min,max,between}ex -> x{min,max,between} - Type now can have namespaces too (e.g. MyCompany::order_id) - Add new clauses 'name', 'summary', 'description', 'tags' - (Re-)add manuals 0.01 2011-11-23 (SHARYANTO) - First release, very preliminary, almost nothing is implemented. Changes from old Data::Schema: - [INCOMPATIBLE] Terminology changes: 'attribute' becomes 'clause', to make it less ambiguous.