Index: 10_forge.html =================================================================== --- 10_forge.html (revision 2746) +++ 10_forge.html (revision 2747) @@ -1,6 +1,6 @@ -

10. cschem implementation - forge

+

10. cschem - forge

{imp10:0} The purpose of the forge plugin is to provide an easy to implement yet generic @@ -15,9 +15,10 @@

{imp10:2} Each entry of the array is one operation. An operation is split into tokens -separated by "::". For example sub::^dip::DIP::footprint is a valid +separated by the separator character, which is a non-alphanumeric character +following the operator (first token). For example sub,^dip,DIP,footprint is a valid operation that uses regexp to replace leading "dip" to DIP in the footprint -attribute. +attribute. Since sub is followed by a comma, the token separator is comma.

{imp10:3} Operations work with the current values of attributes at the time @@ -31,16 +32,16 @@

{imp10:5} Operation summary
operations and arguments in-place array? short description -
sub::pat::str::attr yes map substitutes one match of regex pattern pat with str in attr -
gsub::pat::str::attr yes map substitutes all matches of regex pattern pat with str in attr -
suba::pat::ref::attr yes map substitutes one match of regex pattern pat with the value of the ref attribute in attr -
gsuba::pat::ref::attr yes map substitutes all matches of regex pattern pat with the value of the ref attribute in attr -
delete::attr yes atomic deletes (removes) the attribute -
scalar::attr yes* atomic create attr as scalar if it does not exist; throw an error if it exists as an array -
array::attr yes* atomic create attr as array if it does not exist; throw an error if it exists as a scalar -
copy::dstattr::srcattr no atomic copies the value of srcattr to the destination attribute dstattr (overwriting or creating it) -
append::dstattr::srcattr no darr appends the value of the source attribute srcattr to the value of the destination attribute dstattr -
prepend::dstattr::srcattr no darr prepends the value of the source attribute srcattr to the value of the destination attribute dstattr +
sub,pat,str,attr yes map substitutes one match of regex pattern pat with str in attr +
gsub,pat,str,attr yes map substitutes all matches of regex pattern pat with str in attr +
suba,pat,ref,attr yes map substitutes one match of regex pattern pat with the value of the ref attribute in attr +
gsuba,pat,ref,attr yes map substitutes all matches of regex pattern pat with the value of the ref attribute in attr +
delete,attr yes atomic deletes (removes) the attribute +
scalar,attr yes* atomic create attr as scalar if it does not exist; throw an error if it exists as an array +
array,attr yes* atomic create attr as array if it does not exist; throw an error if it exists as a scalar +
copy,dstattr,srcattr no atomic copies the value of srcattr to the destination attribute dstattr (overwriting or creating it) +
append,dstattr,srcattr no darr appends the value of the source attribute srcattr to the value of the destination attribute dstattr +
prepend,dstattr,srcattr no darr prepends the value of the source attribute srcattr to the value of the destination attribute dstattr

{imp10:6}