fable 3.0.129 → 3.0.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fable.compatible.js +19 -19
- package/dist/fable.compatible.min.js +2 -2
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +19 -19
- package/dist/fable.min.js +2 -2
- package/dist/fable.min.js.map +1 -1
- package/package.json +2 -2
- package/source/services/Fable-Service-MetaTemplate/MetaTemplate-StringParser.js +85 -23
- package/source/services/Fable-Service-MetaTemplate/MetaTemplate-WordTree.js +11 -5
- package/source/services/Fable-Service-MetaTemplate.js +6 -14
- package/test/MetaTemplating_tests.js +21 -1
package/dist/fable.compatible.js
CHANGED
|
@@ -1149,7 +1149,10 @@ return false;}// Now see if the function has arguments.
|
|
|
1149
1149
|
var tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.DataFormat.stringGetEnclosureValueByIndex(pAddress.substring(tmpFunctionAddress.length),0),',');if(tmpFunctionArguments.length==0||tmpFunctionArguments[0]==''){// No arguments... just call the function (bound to the scope of the object it is contained withing)
|
|
1150
1150
|
return pObject[tmpFunctionAddress].apply(pObject);}else{var tmpArgumentValues=[];var _tmpRootObject2=typeof pRootObject=='undefined'?pObject:pRootObject;// Now get the value for each argument
|
|
1151
1151
|
for(var _i4=0;_i4<tmpFunctionArguments.length;_i4++){// Resolve the values for each subsequent entry
|
|
1152
|
-
|
|
1152
|
+
// Check if the argument value is a string literal or a reference to an address
|
|
1153
|
+
if(tmpFunctionArguments[_i4].length>=2&&(tmpFunctionArguments[_i4].charAt(0)=='"'||tmpFunctionArguments[_i4].charAt(0)=="'"||tmpFunctionArguments[_i4].charAt(0)=="`")&&(tmpFunctionArguments[_i4].charAt(tmpFunctionArguments[_i4].length-1)=='"'||tmpFunctionArguments[_i4].charAt(tmpFunctionArguments[_i4].length-1)=="'"||tmpFunctionArguments[_i4].charAt(tmpFunctionArguments[_i4].length-1)=="`")){// This is a string literal
|
|
1154
|
+
tmpArgumentValues.push(tmpFunctionArguments[_i4].substring(1,tmpFunctionArguments[_i4].length-1));}else{// This is a hash address
|
|
1155
|
+
tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject2,tmpFunctionArguments[_i4]));}}return pObject[tmpFunctionAddress].apply(pObject,tmpArgumentValues);}}// Boxed elements look like this:
|
|
1153
1156
|
// MyValues[10]
|
|
1154
1157
|
// MyValues['Name']
|
|
1155
1158
|
// MyValues["Age"]
|
|
@@ -1209,7 +1212,10 @@ return false;}// Now see if the function has arguments.
|
|
|
1209
1212
|
var _tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.DataFormat.stringGetEnclosureValueByIndex(tmpSubObjectName.substring(_tmpFunctionAddress2.length),0),',');if(_tmpFunctionArguments.length==0||_tmpFunctionArguments[0]==''){// No arguments... just call the function (bound to the scope of the object it is contained withing)
|
|
1210
1213
|
return this.getValueAtAddress(pObject[_tmpFunctionAddress2].apply(pObject),tmpNewAddress,tmpParentAddress,tmpRootObject);}else{var _tmpArgumentValues=[];var _tmpRootObject3=typeof pRootObject=='undefined'?pObject:pRootObject;// Now get the value for each argument
|
|
1211
1214
|
for(var _i6=0;_i6<_tmpFunctionArguments.length;_i6++){// Resolve the values for each subsequent entry
|
|
1212
|
-
|
|
1215
|
+
// Check if the argument value is a string literal or a reference to an address
|
|
1216
|
+
if(_tmpFunctionArguments[_i6].length>=2&&(_tmpFunctionArguments[_i6].charAt(0)=='"'||_tmpFunctionArguments[_i6].charAt(0)=="'"||_tmpFunctionArguments[_i6].charAt(0)=="`")&&(_tmpFunctionArguments[_i6].charAt(_tmpFunctionArguments[_i6].length-1)=='"'||_tmpFunctionArguments[_i6].charAt(_tmpFunctionArguments[_i6].length-1)=="'"||_tmpFunctionArguments[_i6].charAt(_tmpFunctionArguments[_i6].length-1)=="`")){// This is a string literal
|
|
1217
|
+
_tmpArgumentValues.push(_tmpFunctionArguments[_i6].substring(1,_tmpFunctionArguments[_i6].length-1));}else{// This is a hash address
|
|
1218
|
+
_tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject3,_tmpFunctionArguments[_i6]));}}return this.getValueAtAddress(pObject[_tmpFunctionAddress2].apply(pObject,_tmpArgumentValues),tmpNewAddress,tmpParentAddress,_tmpRootObject3);}}// Boxed elements look like this:
|
|
1213
1219
|
// MyValues[42]
|
|
1214
1220
|
// MyValues['Color']
|
|
1215
1221
|
// MyValues["Weight"]
|
|
@@ -3630,14 +3636,7 @@ var tmpResult=tmpDegreesArbitraryValue.times(Math.PI).div(180);return tmpResult.
|
|
|
3630
3636
|
* Precedent Meta-Templating
|
|
3631
3637
|
* @author Steven Velozo <steven@velozo.com>
|
|
3632
3638
|
* @description Process text stream trie and postfix tree, parsing out meta-template expression functions.
|
|
3633
|
-
*/var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase7){_inherits(FableServiceMetaTemplate,_libFableServiceBase7);function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this33;_classCallCheck2(this,FableServiceMetaTemplate);_this33=_callSuper(this,FableServiceMetaTemplate,[pFable,pOptions,pServiceHash]);_this33.serviceType='MetaTemplate';_this33.WordTree=new libWordTree();_this33.StringParser=new libStringParser(_this33.fable);_this33.ParseTree=_this33.WordTree.ParseTree;return _this33;}/**
|
|
3634
|
-
* Add a Pattern to the Parse Tree
|
|
3635
|
-
* @method addPattern
|
|
3636
|
-
* @param {Object} pTree - A node on the parse tree to push the characters into
|
|
3637
|
-
* @param {string} pPattern - The string to add to the tree
|
|
3638
|
-
* @param {number} pIndex - callback function
|
|
3639
|
-
* @return {bool} True if adding the pattern was successful
|
|
3640
|
-
*/_createClass2(FableServiceMetaTemplate,[{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,pParser){return this.WordTree.addPattern(pPatternStart,pPatternEnd,pParser);}},{key:"addPatternAsync",value:function addPatternAsync(pPatternStart,pPatternEnd,pParserPromise){return this.WordTree.addPatternAsync(pPatternStart,pPatternEnd,pParserPromise);}},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise){return this.WordTree.addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise);}/**
|
|
3639
|
+
*/var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase7){_inherits(FableServiceMetaTemplate,_libFableServiceBase7);function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this33;_classCallCheck2(this,FableServiceMetaTemplate);_this33=_callSuper(this,FableServiceMetaTemplate,[pFable,pOptions,pServiceHash]);_this33.serviceType='MetaTemplate';_this33.WordTree=new libWordTree();_this33.StringParser=new libStringParser(_this33.fable);_this33.ParseTree=_this33.WordTree.ParseTree;return _this33;}_createClass2(FableServiceMetaTemplate,[{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,pParser,pParserContext){return this.WordTree.addPattern(pPatternStart,pPatternEnd,pParser,pParserContext);}},{key:"addPatternAsync",value:function addPatternAsync(pPatternStart,pPatternEnd,pParserPromise,pParserContext){return this.WordTree.addPatternAsync(pPatternStart,pPatternEnd,pParserPromise,pParserContext);}},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext){return this.WordTree.addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext);}/**
|
|
3641
3640
|
* Parse a string with the existing parse tree
|
|
3642
3641
|
* @method parseString
|
|
3643
3642
|
* @param {string} pString - The string to parse
|
|
@@ -3683,21 +3682,21 @@ if(!pParserState.StartPatternMatchComplete&&pCharacter in pParserState.Pattern){
|
|
|
3683
3682
|
pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// Flush the output buffer.
|
|
3684
3683
|
this.appendOutputBuffer(pCharacter,pParserState);// If this last character is the end of the pattern, parse it.
|
|
3685
3684
|
if('Parse'in pParserState.Pattern&&(!pParserState.Pattern.isAsync||pParserState.Pattern.isBoth)){// Run the function
|
|
3686
|
-
pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);return this.resetOutputBuffer(pParserState);}else{this.fable.log.info("MetaTemplate: The pattern ".concat(pParserState.Pattern.PatternStartString," is asynchronous and cannot be used in a synchronous parser."));return this.resetOutputBuffer(pParserState);}}else if(pCharacter in pParserState.PatternStartNode.PatternEnd){// We broke out of the end -- see if this is a new start of the end.
|
|
3685
|
+
var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}return this.resetOutputBuffer(pParserState);}else{this.fable.log.info("MetaTemplate: The pattern ".concat(pParserState.Pattern.PatternStartString," is asynchronous and cannot be used in a synchronous parser."));return this.resetOutputBuffer(pParserState);}}else if(pCharacter in pParserState.PatternStartNode.PatternEnd){// We broke out of the end -- see if this is a new start of the end.
|
|
3687
3686
|
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{pParserState.EndPatternMatchBegan=false;this.appendOutputBuffer(pCharacter,pParserState);}}else if('PatternEnd'in pParserState.Pattern){if(!pParserState.StartPatternMatchComplete){pParserState.StartPatternMatchComplete=true;pParserState.PatternStartNode=pParserState.Pattern;}this.appendOutputBuffer(pCharacter,pParserState);if(pCharacter in pParserState.Pattern.PatternEnd){// This is the first character of the end pattern.
|
|
3688
3687
|
pParserState.EndPatternMatchBegan=true;// This leaf has a PatternEnd tree, so we will wait until that end is met.
|
|
3689
3688
|
pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// If this last character is the end of the pattern, parse it.
|
|
3690
3689
|
if('Parse'in pParserState.Pattern){if(pParserState.Pattern.isAsync&&!pParserState.Pattern.isBoth){this.fable.log.info("MetaTemplate: The pattern ".concat(pParserState.Pattern.PatternStartString," is asynchronous and cannot be used in a synchronous parser."));this.resetOutputBuffer(pParserState);}else{// Run the t*mplate function
|
|
3691
|
-
pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);return this.resetOutputBuffer(pParserState);}}}}else{// We are in a pattern start but didn't match one; reset and start trying again from this character.
|
|
3690
|
+
var _tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(_tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}return this.resetOutputBuffer(pParserState);}}}}else{// We are in a pattern start but didn't match one; reset and start trying again from this character.
|
|
3692
3691
|
this.resetOutputBuffer(pParserState);}}// If we aren't in a pattern match or pattern, and this isn't the start of a new pattern (RAW mode)....
|
|
3693
3692
|
if(!pParserState.PatternMatch){// This may be the start of a new pattern....
|
|
3694
3693
|
if(pCharacter in pParserState.ParseTree){// ... assign the root node as the matched node.
|
|
3695
3694
|
this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserState);pParserState.Pattern=pParserState.ParseTree[pCharacter];pParserState.PatternMatch=true;return true;}else{this.appendOutputBuffer(pCharacter,pParserState);}}return false;}},{key:"executePatternAsync",value:function executePatternAsync(pParserState,pData,fCallback,pDataContext){var _this34=this;// ... this is the end of a pattern, cut off the end tag and parse it.
|
|
3696
3695
|
// Trim the start and end tags off the output buffer now
|
|
3697
3696
|
if(pParserState.Pattern.isAsync&&!pParserState.Pattern.isBoth){// Run the function
|
|
3698
|
-
return pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this34.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this34.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else if(pParserState.Pattern.isAsync&&pParserState.Pattern.isBoth){// Run the function when both async and non async were provided with the pattern
|
|
3699
|
-
return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this34.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this34.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{// Run the t*mplate function
|
|
3700
|
-
pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);this.resetOutputBuffer(pParserState);return fCallback();}}/**
|
|
3697
|
+
var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){return pParserState.Pattern.Parse.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this34.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this34.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{return pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this34.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this34.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else if(pParserState.Pattern.isAsync&&pParserState.Pattern.isBoth){// Run the function when both async and non async were provided with the pattern
|
|
3698
|
+
var _tmpFunctionContext2='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext2){return pParserState.Pattern.ParseAsync.call(_tmpFunctionContext2,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this34.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this34.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this34.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this34.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else{// Run the t*mplate function
|
|
3699
|
+
var _tmpFunctionContext3='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext3){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(_tmpFunctionContext3,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}this.resetOutputBuffer(pParserState);return fCallback();}}/**
|
|
3701
3700
|
* Parse a character in the buffer.
|
|
3702
3701
|
* @method parseCharacterAsync
|
|
3703
3702
|
* @param {string} pCharacter - The character to append
|
|
@@ -3759,20 +3758,21 @@ _this35.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserSta
|
|
|
3759
3758
|
* @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
|
|
3760
3759
|
* @param {function} fParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
|
|
3761
3760
|
* @return {bool} True if adding the pattern was successful
|
|
3762
|
-
*/},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser){if(pPatternStart.length<1){return false;}if(typeof pPatternEnd==='string'&&pPatternEnd.length<1){return false;}var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
|
|
3763
|
-
for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!('PatternEnd'in tmpLeaf)){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i27=0;_i27<tmpPatternEnd.length;_i27++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i27],_i27);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(){return fParser;}:function(pData){return pData;}
|
|
3761
|
+
*/},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){if(pPatternStart.length<1){return false;}if(typeof pPatternEnd==='string'&&pPatternEnd.length<1){return false;}var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
|
|
3762
|
+
for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!('PatternEnd'in tmpLeaf)){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i27=0;_i27<tmpPatternEnd.length;_i27++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i27],_i27);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(){return fParser;}:function(pData){return pData;};// A "this" for every object
|
|
3763
|
+
if(pParserContext){tmpLeaf.ParserContext=pParserContext;}return tmpLeaf;}/** Add a Pattern to the Parse Tree
|
|
3764
3764
|
* @method addPatternAsync
|
|
3765
3765
|
* @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
|
|
3766
3766
|
* @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
|
|
3767
3767
|
* @param {function} fParserAsync - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
|
|
3768
3768
|
* @return {bool} True if adding the pattern was successful
|
|
3769
|
-
*/},{key:"addPatternAsync",value:function addPatternAsync(pPatternStart,pPatternEnd,fParserAsync){var tmpLeaf=this.addPattern(pPatternStart,pPatternEnd,fParserAsync);if(tmpLeaf){tmpLeaf.isAsync=true;}}/** Add a Pattern to the Parse Tree
|
|
3769
|
+
*/},{key:"addPatternAsync",value:function addPatternAsync(pPatternStart,pPatternEnd,fParserAsync,pParserContext){var tmpLeaf=this.addPattern(pPatternStart,pPatternEnd,fParserAsync,pParserContext);if(tmpLeaf){tmpLeaf.isAsync=true;}}/** Add a Pattern to the Parse Tree
|
|
3770
3770
|
* @method addPatternBoth
|
|
3771
3771
|
* @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
|
|
3772
3772
|
* @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
|
|
3773
3773
|
* @param {function} fParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
|
|
3774
3774
|
* @return {bool} True if adding the pattern was successful
|
|
3775
|
-
*/},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,fParser,fParserAsync){var tmpLeaf=this.addPattern(pPatternStart,pPatternEnd,fParser);if(tmpLeaf){tmpLeaf.isAsync=true;tmpLeaf.isBoth=true;// When a leaf has both async and non-async versions of the functions, we store the async in fParserAsync.
|
|
3775
|
+
*/},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,fParser,fParserAsync,pParserContext){var tmpLeaf=this.addPattern(pPatternStart,pPatternEnd,fParser,pParserContext);if(tmpLeaf){tmpLeaf.isAsync=true;tmpLeaf.isBoth=true;// When a leaf has both async and non-async versions of the functions, we store the async in fParserAsync.
|
|
3776
3776
|
tmpLeaf.ParseAsync=fParserAsync;}}}]);return WordTree;}();module.exports=WordTree;},{}],148:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":0},"Steps":[],"Errors":[],"Log":[]};},{}],149:[function(require,module,exports){var _require4=require('big.js'),PE=_require4.PE;var libFableServiceBase=require('fable-serviceproviderbase');var _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));var FableOperation=/*#__PURE__*/function(_libFableServiceBase8){_inherits(FableOperation,_libFableServiceBase8);function FableOperation(pFable,pOptions,pServiceHash){var _this36;_classCallCheck2(this,FableOperation);_this36=_callSuper(this,FableOperation,[pFable,pOptions,pServiceHash]);// Timestamps will just be the long ints
|
|
3777
3777
|
_this36.timeStamps={};_this36.serviceType='PhasedOperation';_this36.state=JSON.parse(_OperationStatePrototypeString);_this36.stepMap={};_this36.stepFunctions={};// Match the service instantiation to the operation.
|
|
3778
3778
|
_this36.state.Metadata.Hash=_this36.Hash;_this36.state.Metadata.UUID=_this36.UUID;_this36.state.Metadata.Name=typeof _this36.options.Name=='string'?_this36.options.Name:"Unnamed Operation ".concat(_this36.state.Metadata.UUID);_this36.name=_this36.state.Metadata.Name;_this36.progressTrackerSet=_this36.fable.instantiateServiceProviderWithoutRegistration('ProgressTrackerSet');_this36.state.OverallProgressTracker=_this36.progressTrackerSet.createProgressTracker("Overall-".concat(_this36.state.Metadata.UUID));// This is here to use the pass-through logging functions in the operation itself.
|