Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

precedent

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

precedent - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

.c9/metadata/tab3

2

.c9/metadata/workspace/harness/Debug.js

@@ -1,1 +0,1 @@

{"filter":false,"title":"Debug.js","tooltip":"/harness/Debug.js","undoManager":{"mark":1,"position":1,"stack":[[{"start":{"row":7,"column":59},"end":{"row":7,"column":60},"action":"remove","lines":["}"],"id":2}],[{"start":{"row":7,"column":58},"end":{"row":7,"column":59},"action":"remove","lines":["{"],"id":3}]]},"ace":{"folds":[],"customSyntax":"javascript","scrolltop":0,"scrollleft":0,"selection":{"start":{"row":7,"column":0},"end":{"row":10,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":6,"state":"no_regex","mode":"ace/mode/javascript"}},"timestamp":1493840828884,"hash":"65bf7349eefd9757a6f970da48a8e968bdb3a008"}
{"filter":false,"title":"Debug.js","tooltip":"/harness/Debug.js","undoManager":{"mark":-1,"position":-1,"stack":[]},"ace":{"folds":[],"customSyntax":"javascript","scrolltop":0,"scrollleft":0,"selection":{"start":{"row":7,"column":0},"end":{"row":10,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":110,"mode":"ace/mode/javascript"}},"timestamp":1493840828884,"hash":"65bf7349eefd9757a6f970da48a8e968bdb3a008"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"package.json","tooltip":"/package.json","undoManager":{"mark":14,"position":14,"stack":[[{"start":{"row":6,"column":24},"end":{"row":6,"column":25},"action":"remove","lines":["p"],"id":98}],[{"start":{"row":6,"column":24},"end":{"row":6,"column":25},"action":"insert","lines":["P"],"id":99}],[{"start":{"row":2,"column":18},"end":{"row":2,"column":19},"action":"remove","lines":["2"],"id":100}],[{"start":{"row":2,"column":18},"end":{"row":2,"column":19},"action":"insert","lines":["3"],"id":101}],[{"start":{"row":4,"column":18},"end":{"row":4,"column":27},"action":"remove","lines":["Stricture"],"id":102},{"start":{"row":4,"column":18},"end":{"row":4,"column":27},"action":"insert","lines":["Precedent"]}],[{"start":{"row":23,"column":44},"end":{"row":23,"column":53},"action":"remove","lines":["stricture"],"id":103},{"start":{"row":23,"column":44},"end":{"row":23,"column":45},"action":"insert","lines":["p"]}],[{"start":{"row":23,"column":45},"end":{"row":23,"column":46},"action":"insert","lines":["r"],"id":104}],[{"start":{"row":23,"column":46},"end":{"row":23,"column":47},"action":"insert","lines":["e"],"id":105}],[{"start":{"row":23,"column":47},"end":{"row":23,"column":48},"action":"insert","lines":["c"],"id":106}],[{"start":{"row":23,"column":48},"end":{"row":23,"column":49},"action":"insert","lines":["e"],"id":107}],[{"start":{"row":23,"column":49},"end":{"row":23,"column":50},"action":"insert","lines":["d"],"id":108}],[{"start":{"row":23,"column":50},"end":{"row":23,"column":51},"action":"insert","lines":["e"],"id":109}],[{"start":{"row":23,"column":51},"end":{"row":23,"column":52},"action":"insert","lines":["n"],"id":110}],[{"start":{"row":23,"column":52},"end":{"row":23,"column":53},"action":"insert","lines":["t"],"id":111}],[{"start":{"row":15,"column":44},"end":{"row":15,"column":53},"action":"remove","lines":["stricture"],"id":112},{"start":{"row":15,"column":44},"end":{"row":15,"column":53},"action":"insert","lines":["precedent"]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":15,"column":53},"end":{"row":15,"column":53},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1493932057834,"hash":"37186deae43bf97aa229e1f5dadbe6188d23a0fe"}
{"filter":false,"title":"package.json","tooltip":"/package.json","undoManager":{"mark":16,"position":16,"stack":[[{"start":{"row":6,"column":24},"end":{"row":6,"column":25},"action":"remove","lines":["p"],"id":98}],[{"start":{"row":6,"column":24},"end":{"row":6,"column":25},"action":"insert","lines":["P"],"id":99}],[{"start":{"row":2,"column":18},"end":{"row":2,"column":19},"action":"remove","lines":["2"],"id":100}],[{"start":{"row":2,"column":18},"end":{"row":2,"column":19},"action":"insert","lines":["3"],"id":101}],[{"start":{"row":4,"column":18},"end":{"row":4,"column":27},"action":"remove","lines":["Stricture"],"id":102},{"start":{"row":4,"column":18},"end":{"row":4,"column":27},"action":"insert","lines":["Precedent"]}],[{"start":{"row":23,"column":44},"end":{"row":23,"column":53},"action":"remove","lines":["stricture"],"id":103},{"start":{"row":23,"column":44},"end":{"row":23,"column":45},"action":"insert","lines":["p"]}],[{"start":{"row":23,"column":45},"end":{"row":23,"column":46},"action":"insert","lines":["r"],"id":104}],[{"start":{"row":23,"column":46},"end":{"row":23,"column":47},"action":"insert","lines":["e"],"id":105}],[{"start":{"row":23,"column":47},"end":{"row":23,"column":48},"action":"insert","lines":["c"],"id":106}],[{"start":{"row":23,"column":48},"end":{"row":23,"column":49},"action":"insert","lines":["e"],"id":107}],[{"start":{"row":23,"column":49},"end":{"row":23,"column":50},"action":"insert","lines":["d"],"id":108}],[{"start":{"row":23,"column":50},"end":{"row":23,"column":51},"action":"insert","lines":["e"],"id":109}],[{"start":{"row":23,"column":51},"end":{"row":23,"column":52},"action":"insert","lines":["n"],"id":110}],[{"start":{"row":23,"column":52},"end":{"row":23,"column":53},"action":"insert","lines":["t"],"id":111}],[{"start":{"row":15,"column":44},"end":{"row":15,"column":53},"action":"remove","lines":["stricture"],"id":112},{"start":{"row":15,"column":44},"end":{"row":15,"column":53},"action":"insert","lines":["precedent"]}],[{"start":{"row":2,"column":18},"end":{"row":2,"column":19},"action":"remove","lines":["3"],"id":113}],[{"start":{"row":2,"column":18},"end":{"row":2,"column":19},"action":"insert","lines":["4"],"id":114}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":2,"column":19},"end":{"row":2,"column":19},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":119,"mode":"ace/mode/json"}},"timestamp":1494777637964,"hash":"1767dcafa9ee61fa71c8aaa4cabb08be6f5e3294"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"Precedent.js","tooltip":"/source/Precedent.js","undoManager":{"mark":7,"position":7,"stack":[[{"start":{"row":18,"column":0},"end":{"row":19,"column":0},"action":"remove","lines":["\t\t\treturn {new: createNew};",""],"id":5235}],[{"start":{"row":15,"column":0},"end":{"row":38,"column":0},"action":"remove","lines":["\t\t// If a valid object isn't passed in, return a constructor","\t\tif (typeof(pSettings) !== 'object')","\t\t{","\t\t}","","\t\tvar _Fable = false;","\t\t// If this is a Fable object, use it.","\t\tif (pSettings.hasOwnProperty('fable'))","\t\t{","\t\t\t_Fable = pSettings.fable;","\t\t\t// Fill in any unset settings from the default options.","\t\t\t_Fable.settingsManager.fill(require(__dirname+'/Precedent-Options.js'));","\t\t}","\t\telse","\t\t{","\t\t\t// See if any settings were passed in","\t\t\tvar tmpPassedSettings = (typeof(pSettings) === 'object') ? pSettings : {};","\t\t\t// Get the default settings (and command-line options)","\t\t\tvar tmpSettings = libLodash.assign(require(__dirname+'/Precedent-Options.js'), tmpPassedSettings);","\t\t\t// Construct a new fable","\t\t\t_Fable = require('fable').new(tmpSettings);","\t\t}","",""],"id":5236}],[{"start":{"row":15,"column":0},"end":{"row":16,"column":0},"action":"remove","lines":["\t\t//_Fable.log.info('Initializing precedent...');",""],"id":5237}],[{"start":{"row":151,"column":0},"end":{"row":152,"column":0},"action":"remove","lines":["\treturn createNew();",""],"id":5238},{"start":{"row":151,"column":0},"end":{"row":152,"column":0},"action":"insert","lines":["\t\t\treturn {new: createNew};",""]}],[{"start":{"row":151,"column":0},"end":{"row":151,"column":1},"action":"remove","lines":["\t"],"id":5239}],[{"start":{"row":151,"column":0},"end":{"row":151,"column":1},"action":"remove","lines":["\t"],"id":5240}],[{"start":{"row":9,"column":0},"end":{"row":10,"column":0},"action":"remove","lines":["var libLodash = require('lodash');",""],"id":5241}],[{"start":{"row":9,"column":0},"end":{"row":10,"column":0},"action":"remove","lines":["",""],"id":5242}]]},"ace":{"folds":[],"customSyntax":"javascript","scrolltop":2119.5,"scrollleft":0,"selection":{"start":{"row":143,"column":4},"end":{"row":143,"column":15},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":131,"state":"no_regex","mode":"ace/mode/javascript"}},"timestamp":1493840786446,"hash":"9716fd2918c4471fb58d134c64c8ed353cbd501b"}
{"filter":false,"title":"Precedent.js","tooltip":"/source/Precedent.js","undoManager":{"mark":100,"position":100,"stack":[[{"start":{"row":124,"column":0},"end":{"row":130,"column":0},"action":"insert","lines":["\t\t\telse if (pParserState.Pattern)","\t\t\t{","\t\t\t\tappendOutputBuffer(pCharacter, pParserState);","\t\t\t\t// ... Check if this is the end of the pattern...","\t\t\t\tcheckPatternEnd(pParserState);","\t\t\t}",""],"id":6572}],[{"start":{"row":129,"column":0},"end":{"row":130,"column":0},"action":"remove","lines":["\t\t\t}",""],"id":6573}],[{"start":{"row":124,"column":0},"end":{"row":124,"column":1},"action":"insert","lines":["\t"],"id":6574},{"start":{"row":125,"column":0},"end":{"row":125,"column":1},"action":"insert","lines":["\t"]},{"start":{"row":126,"column":0},"end":{"row":126,"column":1},"action":"insert","lines":["\t"]},{"start":{"row":127,"column":0},"end":{"row":127,"column":1},"action":"insert","lines":["\t"]},{"start":{"row":128,"column":0},"end":{"row":128,"column":1},"action":"insert","lines":["\t"]}],[{"start":{"row":126,"column":0},"end":{"row":127,"column":0},"action":"remove","lines":["\t\t\t\t\tappendOutputBuffer(pCharacter, pParserState);",""],"id":6575}],[{"start":{"row":124,"column":8},"end":{"row":124,"column":9},"action":"remove","lines":[" "],"id":6576}],[{"start":{"row":124,"column":7},"end":{"row":124,"column":8},"action":"remove","lines":["e"],"id":6577}],[{"start":{"row":124,"column":6},"end":{"row":124,"column":7},"action":"remove","lines":["s"],"id":6578}],[{"start":{"row":124,"column":5},"end":{"row":124,"column":6},"action":"remove","lines":["l"],"id":6579}],[{"start":{"row":124,"column":4},"end":{"row":124,"column":5},"action":"remove","lines":["e"],"id":6580}],[{"start":{"row":127,"column":35},"end":{"row":128,"column":0},"action":"insert","lines":["",""],"id":6581},{"start":{"row":128,"column":0},"end":{"row":128,"column":5},"action":"insert","lines":["\t\t\t\t\t"]}],[{"start":{"row":128,"column":5},"end":{"row":128,"column":6},"action":"insert","lines":["}"],"id":6582},{"start":{"row":128,"column":0},"end":{"row":128,"column":5},"action":"remove","lines":["\t\t\t\t\t"]},{"start":{"row":128,"column":0},"end":{"row":128,"column":4},"action":"insert","lines":["\t\t\t\t"]}],[{"start":{"row":126,"column":51},"end":{"row":126,"column":52},"action":"insert","lines":[" "],"id":6583}],[{"start":{"row":126,"column":52},"end":{"row":126,"column":53},"action":"insert","lines":["("],"id":6584}],[{"start":{"row":126,"column":53},"end":{"row":126,"column":54},"action":"insert","lines":["i"],"id":6585}],[{"start":{"row":126,"column":54},"end":{"row":126,"column":55},"action":"insert","lines":["f"],"id":6586}],[{"start":{"row":126,"column":55},"end":{"row":126,"column":56},"action":"insert","lines":[" "],"id":6587}],[{"start":{"row":126,"column":56},"end":{"row":126,"column":57},"action":"insert","lines":["w"],"id":6588}],[{"start":{"row":126,"column":57},"end":{"row":126,"column":58},"action":"insert","lines":["e"],"id":6589}],[{"start":{"row":126,"column":58},"end":{"row":126,"column":59},"action":"insert","lines":[" "],"id":6590}],[{"start":{"row":126,"column":59},"end":{"row":126,"column":60},"action":"insert","lines":["a"],"id":6591}],[{"start":{"row":126,"column":60},"end":{"row":126,"column":61},"action":"insert","lines":["r"],"id":6592}],[{"start":{"row":126,"column":61},"end":{"row":126,"column":62},"action":"insert","lines":["e"],"id":6593}],[{"start":{"row":126,"column":62},"end":{"row":126,"column":63},"action":"insert","lines":[" "],"id":6594}],[{"start":{"row":126,"column":63},"end":{"row":126,"column":64},"action":"insert","lines":["m"],"id":6595}],[{"start":{"row":126,"column":64},"end":{"row":126,"column":65},"action":"insert","lines":["a"],"id":6596}],[{"start":{"row":126,"column":65},"end":{"row":126,"column":66},"action":"insert","lines":["t"],"id":6597}],[{"start":{"row":126,"column":66},"end":{"row":126,"column":67},"action":"insert","lines":["c"],"id":6598}],[{"start":{"row":126,"column":67},"end":{"row":126,"column":68},"action":"insert","lines":["h"],"id":6599}],[{"start":{"row":126,"column":68},"end":{"row":126,"column":69},"action":"insert","lines":["i"],"id":6600}],[{"start":{"row":126,"column":69},"end":{"row":126,"column":70},"action":"insert","lines":["n"],"id":6601}],[{"start":{"row":126,"column":70},"end":{"row":126,"column":71},"action":"insert","lines":["g"],"id":6602}],[{"start":{"row":126,"column":71},"end":{"row":126,"column":72},"action":"insert","lines":[" "],"id":6603}],[{"start":{"row":126,"column":72},"end":{"row":126,"column":73},"action":"insert","lines":["a"],"id":6604}],[{"start":{"row":126,"column":73},"end":{"row":126,"column":74},"action":"insert","lines":[" "],"id":6605}],[{"start":{"row":126,"column":74},"end":{"row":126,"column":75},"action":"insert","lines":["v"],"id":6606}],[{"start":{"row":126,"column":75},"end":{"row":126,"column":76},"action":"insert","lines":["a"],"id":6607}],[{"start":{"row":126,"column":76},"end":{"row":126,"column":77},"action":"insert","lines":["l"],"id":6608}],[{"start":{"row":126,"column":77},"end":{"row":126,"column":78},"action":"insert","lines":["i"],"id":6609}],[{"start":{"row":126,"column":78},"end":{"row":126,"column":79},"action":"insert","lines":["d"],"id":6610}],[{"start":{"row":126,"column":79},"end":{"row":126,"column":80},"action":"insert","lines":[" "],"id":6611}],[{"start":{"row":126,"column":80},"end":{"row":126,"column":81},"action":"insert","lines":["p"],"id":6612}],[{"start":{"row":126,"column":81},"end":{"row":126,"column":82},"action":"insert","lines":["a"],"id":6613}],[{"start":{"row":126,"column":82},"end":{"row":126,"column":83},"action":"insert","lines":["t"],"id":6614}],[{"start":{"row":126,"column":83},"end":{"row":126,"column":84},"action":"insert","lines":["t"],"id":6615}],[{"start":{"row":126,"column":84},"end":{"row":126,"column":85},"action":"insert","lines":["e"],"id":6616}],[{"start":{"row":126,"column":85},"end":{"row":126,"column":86},"action":"insert","lines":["r"],"id":6617}],[{"start":{"row":126,"column":86},"end":{"row":126,"column":87},"action":"insert","lines":["n"],"id":6618}],[{"start":{"row":126,"column":87},"end":{"row":126,"column":88},"action":"insert","lines":[")"],"id":6619}],[{"start":{"row":130,"column":7},"end":{"row":130,"column":8},"action":"remove","lines":["2"],"id":6620}],[{"start":{"row":130,"column":7},"end":{"row":130,"column":8},"action":"insert","lines":["3"],"id":6621}],[{"start":{"row":97,"column":0},"end":{"row":99,"column":0},"action":"remove","lines":["\t\t\t\t","\t\t\t\treturn true;",""],"id":6622}],[{"start":{"row":98,"column":0},"end":{"row":100,"column":0},"action":"remove","lines":["\t\t\t","\t\t\treturn false;",""],"id":6623}],[{"start":{"row":144,"column":3},"end":{"row":144,"column":55},"action":"remove","lines":["tmpParserState.Output += tmpParserState.OutputBuffer"],"id":6624},{"start":{"row":144,"column":3},"end":{"row":144,"column":4},"action":"insert","lines":["f"]}],[{"start":{"row":144,"column":4},"end":{"row":144,"column":5},"action":"insert","lines":["l"],"id":6625}],[{"start":{"row":144,"column":5},"end":{"row":144,"column":6},"action":"insert","lines":["u"],"id":6626}],[{"start":{"row":144,"column":6},"end":{"row":144,"column":7},"action":"insert","lines":["s"],"id":6627}],[{"start":{"row":144,"column":7},"end":{"row":144,"column":8},"action":"insert","lines":["h"],"id":6628}],[{"start":{"row":144,"column":8},"end":{"row":144,"column":9},"action":"insert","lines":["O"],"id":6629}],[{"start":{"row":144,"column":3},"end":{"row":144,"column":9},"action":"remove","lines":["flushO"],"id":6630},{"start":{"row":144,"column":3},"end":{"row":144,"column":22},"action":"insert","lines":["flushOutputBuffer()"]}],[{"start":{"row":144,"column":21},"end":{"row":144,"column":23},"action":"insert","lines":["()"],"id":6631}],[{"start":{"row":144,"column":22},"end":{"row":144,"column":23},"action":"insert","lines":["p"],"id":6632}],[{"start":{"row":144,"column":22},"end":{"row":144,"column":23},"action":"remove","lines":["p"],"id":6633}],[{"start":{"row":144,"column":22},"end":{"row":144,"column":23},"action":"insert","lines":["t"],"id":6634}],[{"start":{"row":144,"column":23},"end":{"row":144,"column":24},"action":"insert","lines":["m"],"id":6635}],[{"start":{"row":144,"column":24},"end":{"row":144,"column":25},"action":"insert","lines":["p"],"id":6636}],[{"start":{"row":144,"column":24},"end":{"row":144,"column":25},"action":"remove","lines":["p"],"id":6637}],[{"start":{"row":144,"column":23},"end":{"row":144,"column":24},"action":"remove","lines":["m"],"id":6638}],[{"start":{"row":144,"column":22},"end":{"row":144,"column":23},"action":"remove","lines":["t"],"id":6639}],[{"start":{"row":144,"column":21},"end":{"row":144,"column":23},"action":"remove","lines":["()"],"id":6640}],[{"start":{"row":144,"column":21},"end":{"row":144,"column":22},"action":"insert","lines":["t"],"id":6641}],[{"start":{"row":144,"column":22},"end":{"row":144,"column":23},"action":"insert","lines":["m"],"id":6642}],[{"start":{"row":144,"column":23},"end":{"row":144,"column":24},"action":"insert","lines":["p"],"id":6643}],[{"start":{"row":144,"column":24},"end":{"row":144,"column":25},"action":"insert","lines":["P"],"id":6644}],[{"start":{"row":144,"column":21},"end":{"row":144,"column":25},"action":"remove","lines":["tmpP"],"id":6645},{"start":{"row":144,"column":21},"end":{"row":144,"column":35},"action":"insert","lines":["tmpParserState"]}],[{"start":{"row":111,"column":12},"end":{"row":111,"column":37},"action":"remove","lines":["!pParserState.Pattern && "],"id":6646}],[{"start":{"row":104,"column":7},"end":{"row":104,"column":32},"action":"remove","lines":["!pParserState.Pattern && "],"id":6647}],[{"start":{"row":91,"column":92},"end":{"row":91,"column":93},"action":"remove","lines":["0"],"id":6648}],[{"start":{"row":91,"column":92},"end":{"row":91,"column":132},"action":"insert","lines":["pParserState.Pattern.PatternStart.length"],"id":6649}],[{"start":{"row":91,"column":132},"end":{"row":91,"column":133},"action":"insert","lines":["-"],"id":6650}],[{"start":{"row":91,"column":133},"end":{"row":91,"column":134},"action":"insert","lines":["1"],"id":6651}],[{"start":{"row":90,"column":60},"end":{"row":91,"column":0},"action":"insert","lines":["",""],"id":6652},{"start":{"row":91,"column":0},"end":{"row":91,"column":4},"action":"insert","lines":["\t\t\t\t"]}],[{"start":{"row":91,"column":4},"end":{"row":91,"column":5},"action":"insert","lines":["c"],"id":6653}],[{"start":{"row":91,"column":5},"end":{"row":91,"column":6},"action":"insert","lines":["o"],"id":6654}],[{"start":{"row":91,"column":6},"end":{"row":91,"column":7},"action":"insert","lines":["n"],"id":6655}],[{"start":{"row":91,"column":7},"end":{"row":91,"column":8},"action":"insert","lines":["s"],"id":6656}],[{"start":{"row":91,"column":8},"end":{"row":91,"column":9},"action":"insert","lines":["o"],"id":6657}],[{"start":{"row":91,"column":9},"end":{"row":91,"column":10},"action":"insert","lines":["l"],"id":6658}],[{"start":{"row":91,"column":10},"end":{"row":91,"column":11},"action":"insert","lines":["e"],"id":6659}],[{"start":{"row":91,"column":11},"end":{"row":91,"column":12},"action":"insert","lines":["."],"id":6660}],[{"start":{"row":91,"column":12},"end":{"row":91,"column":13},"action":"insert","lines":["l"],"id":6661}],[{"start":{"row":91,"column":13},"end":{"row":91,"column":14},"action":"insert","lines":["o"],"id":6662}],[{"start":{"row":91,"column":14},"end":{"row":91,"column":15},"action":"insert","lines":["g"],"id":6663}],[{"start":{"row":91,"column":15},"end":{"row":91,"column":17},"action":"insert","lines":["()"],"id":6664}],[{"start":{"row":91,"column":16},"end":{"row":91,"column":41},"action":"insert","lines":["pParserState.OutputBuffer"],"id":6665}],[{"start":{"row":91,"column":0},"end":{"row":92,"column":0},"action":"remove","lines":["\t\t\t\tconsole.log(pParserState.OutputBuffer)",""],"id":6666}],[{"start":{"row":91,"column":0},"end":{"row":92,"column":0},"action":"insert","lines":["\t\t\t\tconsole.log(pParserState.OutputBuffer)",""],"id":6667}],[{"start":{"row":93,"column":0},"end":{"row":94,"column":0},"action":"insert","lines":["\t\t\t\tconsole.log(pParserState.OutputBuffer)",""],"id":6669}],[{"start":{"row":92,"column":133},"end":{"row":92,"column":134},"action":"remove","lines":["1"],"id":6670}],[{"start":{"row":92,"column":132},"end":{"row":92,"column":133},"action":"remove","lines":["-"],"id":6671}],[{"start":{"row":91,"column":0},"end":{"row":92,"column":0},"action":"remove","lines":["\t\t\t\tconsole.log(pParserState.OutputBuffer)",""],"id":6672}],[{"start":{"row":92,"column":0},"end":{"row":93,"column":0},"action":"remove","lines":["\t\t\t\tconsole.log(pParserState.OutputBuffer)",""],"id":6673}]]},"ace":{"folds":[],"customSyntax":"javascript","scrolltop":1166,"scrollleft":0,"selection":{"start":{"row":92,"column":0},"end":{"row":92,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":71,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1494787168210,"hash":"5c6b8e69e0459b1d5556f45c62658e0771dbd47d"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"Precedent_tests.js","tooltip":"/test/Precedent_tests.js","undoManager":{"mark":-1,"position":-1,"stack":[]},"ace":{"folds":[],"scrolltop":4.5,"scrollleft":0,"selection":{"start":{"row":19,"column":52},"end":{"row":19,"column":52},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1493840835105,"hash":"bf49aaa4ad775abc21c68071917f5091890de424"}
{"filter":false,"title":"Precedent_tests.js","tooltip":"/test/Precedent_tests.js","undoManager":{"mark":100,"position":100,"stack":[[{"start":{"row":140,"column":53},"end":{"row":141,"column":0},"action":"insert","lines":["",""],"id":221},{"start":{"row":141,"column":0},"end":{"row":141,"column":7},"action":"insert","lines":["\t\t\t\t\t\t\t"]}],[{"start":{"row":141,"column":7},"end":{"row":141,"column":8},"action":"insert","lines":["}"],"id":222},{"start":{"row":141,"column":0},"end":{"row":141,"column":7},"action":"remove","lines":["\t\t\t\t\t\t\t"]},{"start":{"row":141,"column":0},"end":{"row":141,"column":6},"action":"insert","lines":["\t\t\t\t\t\t"]}],[{"start":{"row":136,"column":25},"end":{"row":137,"column":0},"action":"insert","lines":["",""],"id":223},{"start":{"row":137,"column":0},"end":{"row":137,"column":6},"action":"insert","lines":["\t\t\t\t\t\t"]}],[{"start":{"row":137,"column":6},"end":{"row":137,"column":7},"action":"insert","lines":["/"],"id":224}],[{"start":{"row":137,"column":7},"end":{"row":137,"column":8},"action":"insert","lines":["/"],"id":225}],[{"start":{"row":137,"column":8},"end":{"row":137,"column":9},"action":"insert","lines":[" "],"id":226}],[{"start":{"row":137,"column":9},"end":{"row":137,"column":10},"action":"insert","lines":["T"],"id":227}],[{"start":{"row":137,"column":10},"end":{"row":137,"column":11},"action":"insert","lines":["e"],"id":228}],[{"start":{"row":137,"column":11},"end":{"row":137,"column":12},"action":"insert","lines":["s"],"id":229}],[{"start":{"row":137,"column":12},"end":{"row":137,"column":13},"action":"insert","lines":["t"],"id":230}],[{"start":{"row":137,"column":13},"end":{"row":137,"column":14},"action":"insert","lines":[" "],"id":231}],[{"start":{"row":137,"column":14},"end":{"row":137,"column":15},"action":"insert","lines":["e"],"id":232}],[{"start":{"row":137,"column":15},"end":{"row":137,"column":16},"action":"insert","lines":["v"],"id":233}],[{"start":{"row":137,"column":16},"end":{"row":137,"column":17},"action":"insert","lines":["e"],"id":234}],[{"start":{"row":137,"column":17},"end":{"row":137,"column":18},"action":"insert","lines":["r"],"id":235}],[{"start":{"row":137,"column":18},"end":{"row":137,"column":19},"action":"insert","lines":["y"],"id":236}],[{"start":{"row":137,"column":19},"end":{"row":137,"column":20},"action":"insert","lines":[" "],"id":237}],[{"start":{"row":137,"column":20},"end":{"row":137,"column":21},"action":"insert","lines":["o"],"id":238}],[{"start":{"row":137,"column":21},"end":{"row":137,"column":22},"action":"insert","lines":["t"],"id":239}],[{"start":{"row":137,"column":22},"end":{"row":137,"column":23},"action":"insert","lines":["h"],"id":240}],[{"start":{"row":137,"column":23},"end":{"row":137,"column":24},"action":"insert","lines":["e"],"id":241}],[{"start":{"row":137,"column":23},"end":{"row":137,"column":24},"action":"remove","lines":["e"],"id":242}],[{"start":{"row":137,"column":22},"end":{"row":137,"column":23},"action":"remove","lines":["h"],"id":243}],[{"start":{"row":137,"column":21},"end":{"row":137,"column":22},"action":"remove","lines":["t"],"id":244}],[{"start":{"row":137,"column":20},"end":{"row":137,"column":21},"action":"remove","lines":["o"],"id":245}],[{"start":{"row":137,"column":20},"end":{"row":137,"column":21},"action":"insert","lines":["p"],"id":246}],[{"start":{"row":137,"column":21},"end":{"row":137,"column":22},"action":"insert","lines":["a"],"id":247}],[{"start":{"row":137,"column":22},"end":{"row":137,"column":23},"action":"insert","lines":["i"],"id":248}],[{"start":{"row":137,"column":23},"end":{"row":137,"column":24},"action":"insert","lines":["r"],"id":249}],[{"start":{"row":137,"column":24},"end":{"row":137,"column":25},"action":"insert","lines":[" "],"id":250}],[{"start":{"row":137,"column":25},"end":{"row":137,"column":26},"action":"insert","lines":["i"],"id":251}],[{"start":{"row":137,"column":26},"end":{"row":137,"column":27},"action":"insert","lines":["n"],"id":252}],[{"start":{"row":137,"column":27},"end":{"row":137,"column":28},"action":"insert","lines":[" "],"id":253}],[{"start":{"row":137,"column":28},"end":{"row":137,"column":29},"action":"insert","lines":["T"],"id":254}],[{"start":{"row":137,"column":29},"end":{"row":137,"column":30},"action":"insert","lines":["e"],"id":255}],[{"start":{"row":137,"column":30},"end":{"row":137,"column":31},"action":"insert","lines":["s"],"id":256}],[{"start":{"row":137,"column":31},"end":{"row":137,"column":32},"action":"insert","lines":["t"],"id":257}],[{"start":{"row":137,"column":32},"end":{"row":137,"column":33},"action":"insert","lines":["S"],"id":258}],[{"start":{"row":137,"column":33},"end":{"row":137,"column":34},"action":"insert","lines":["t"],"id":259}],[{"start":{"row":137,"column":34},"end":{"row":137,"column":35},"action":"insert","lines":["r"],"id":260}],[{"start":{"row":137,"column":35},"end":{"row":137,"column":36},"action":"insert","lines":["i"],"id":261}],[{"start":{"row":137,"column":36},"end":{"row":137,"column":37},"action":"insert","lines":["n"],"id":262}],[{"start":{"row":137,"column":37},"end":{"row":137,"column":38},"action":"insert","lines":["g"],"id":263}],[{"start":{"row":137,"column":38},"end":{"row":137,"column":39},"action":"insert","lines":["s"],"id":264}],[{"start":{"row":138,"column":53},"end":{"row":138,"column":54},"action":"remove","lines":["+"],"id":265}],[{"start":{"row":138,"column":52},"end":{"row":138,"column":53},"action":"remove","lines":["+"],"id":266}],[{"start":{"row":138,"column":51},"end":{"row":138,"column":52},"action":"remove","lines":["+"],"id":267}],[{"start":{"row":138,"column":51},"end":{"row":138,"column":52},"action":"insert","lines":["="],"id":268}],[{"start":{"row":138,"column":52},"end":{"row":138,"column":53},"action":"insert","lines":["2"],"id":269}],[{"start":{"row":140,"column":45},"end":{"row":140,"column":58},"action":"remove","lines":["tmpTestString"],"id":270},{"start":{"row":140,"column":45},"end":{"row":140,"column":59},"action":"insert","lines":["tmpTestStrings"]}],[{"start":{"row":140,"column":59},"end":{"row":140,"column":61},"action":"insert","lines":["[]"],"id":271}],[{"start":{"row":140,"column":60},"end":{"row":140,"column":61},"action":"insert","lines":["i"],"id":272}],[{"start":{"row":141,"column":34},"end":{"row":141,"column":51},"action":"remove","lines":["tmpExpectedResult"],"id":273},{"start":{"row":141,"column":34},"end":{"row":141,"column":48},"action":"insert","lines":["tmpTestStrings"]}],[{"start":{"row":141,"column":48},"end":{"row":141,"column":50},"action":"insert","lines":["[]"],"id":274}],[{"start":{"row":141,"column":49},"end":{"row":141,"column":50},"action":"insert","lines":["i"],"id":275}],[{"start":{"row":141,"column":50},"end":{"row":141,"column":51},"action":"insert","lines":["+"],"id":276}],[{"start":{"row":141,"column":51},"end":{"row":141,"column":52},"action":"insert","lines":["1"],"id":277}],[{"start":{"row":128,"column":0},"end":{"row":129,"column":0},"action":"insert","lines":["",""],"id":278}],[{"start":{"row":130,"column":66},"end":{"row":130,"column":67},"action":"remove","lines":[","],"id":279}],[{"start":{"row":126,"column":0},"end":{"row":129,"column":0},"action":"remove","lines":["\t\t\t\t\t\t\t'Match this <> and this <here> please.',","\t\t\t\t\t\t\t'Match this SHORTEST_MATCH and this SHORTEST_MATCH please.',","",""],"id":280}],[{"start":{"row":126,"column":0},"end":{"row":129,"column":0},"action":"insert","lines":["\t\t\t\t\t\t\t'Match this <> and this <here> please.',","\t\t\t\t\t\t\t'Match this SHORTEST_MATCH and this SHORTEST_MATCH please.',","",""],"id":281}],[{"start":{"row":129,"column":0},"end":{"row":132,"column":0},"action":"insert","lines":["\t\t\t\t\t\t\t'Match this <> and this <here> please.',","\t\t\t\t\t\t\t'Match this SHORTEST_MATCH and this SHORTEST_MATCH please.',","",""],"id":282}],[{"start":{"row":129,"column":20},"end":{"row":129,"column":21},"action":"insert","lines":["<"],"id":283}],[{"start":{"row":129,"column":33},"end":{"row":129,"column":34},"action":"insert","lines":["<"],"id":284}],[{"start":{"row":132,"column":20},"end":{"row":132,"column":21},"action":"insert","lines":["<"],"id":285}],[{"start":{"row":132,"column":21},"end":{"row":132,"column":22},"action":"insert","lines":["<"],"id":286}],[{"start":{"row":132,"column":22},"end":{"row":132,"column":23},"action":"insert","lines":["<"],"id":287}],[{"start":{"row":130,"column":8},"end":{"row":130,"column":65},"action":"remove","lines":["Match this SHORTEST_MATCH and this SHORTEST_MATCH please."],"id":288},{"start":{"row":130,"column":8},"end":{"row":130,"column":61},"action":"insert","lines":["Match this MEDIUM_MATCH and this MEDIUM_MATCH please."]}],[{"start":{"row":133,"column":19},"end":{"row":133,"column":33},"action":"remove","lines":["SHORTEST_MATCH"],"id":289},{"start":{"row":133,"column":19},"end":{"row":133,"column":31},"action":"insert","lines":["MEDIUM_MATCH"]}],[{"start":{"row":129,"column":0},"end":{"row":132,"column":0},"action":"remove","lines":["\t\t\t\t\t\t\t'Match this <<> and this <<here> please.',","\t\t\t\t\t\t\t'Match this MEDIUM_MATCH and this MEDIUM_MATCH please.',","",""],"id":290}],[{"start":{"row":129,"column":0},"end":{"row":132,"column":0},"action":"insert","lines":["\t\t\t\t\t\t\t'Match this <<> and this <<here> please.',","\t\t\t\t\t\t\t'Match this MEDIUM_MATCH and this MEDIUM_MATCH please.',","",""],"id":291}],[{"start":{"row":132,"column":0},"end":{"row":135,"column":0},"action":"insert","lines":["\t\t\t\t\t\t\t'Match this <<> and this <<here> please.',","\t\t\t\t\t\t\t'Match this MEDIUM_MATCH and this MEDIUM_MATCH please.',","",""],"id":292}],[{"start":{"row":132,"column":21},"end":{"row":132,"column":22},"action":"insert","lines":["E"],"id":293}],[{"start":{"row":132,"column":22},"end":{"row":132,"column":23},"action":"insert","lines":["X"],"id":294}],[{"start":{"row":132,"column":23},"end":{"row":132,"column":24},"action":"insert","lines":["T"],"id":295}],[{"start":{"row":132,"column":24},"end":{"row":132,"column":25},"action":"insert","lines":["R"],"id":296}],[{"start":{"row":132,"column":25},"end":{"row":132,"column":26},"action":"insert","lines":["A"],"id":297}],[{"start":{"row":132,"column":26},"end":{"row":132,"column":27},"action":"insert","lines":["L"],"id":298}],[{"start":{"row":132,"column":27},"end":{"row":132,"column":28},"action":"insert","lines":["O"],"id":299}],[{"start":{"row":132,"column":28},"end":{"row":132,"column":29},"action":"insert","lines":["N"],"id":300}],[{"start":{"row":132,"column":29},"end":{"row":132,"column":30},"action":"insert","lines":["G"],"id":301}],[{"start":{"row":133,"column":19},"end":{"row":133,"column":31},"action":"remove","lines":["MEDIUM_MATCH"],"id":302},{"start":{"row":133,"column":19},"end":{"row":133,"column":35},"action":"insert","lines":["EXTRA_LONG_MATCH"]}],[{"start":{"row":129,"column":0},"end":{"row":132,"column":0},"action":"remove","lines":["\t\t\t\t\t\t\t'Match this <<> and this <<here> please.',","\t\t\t\t\t\t\t'Match this MEDIUM_MATCH and this MEDIUM_MATCH please.',","",""],"id":303}],[{"start":{"row":129,"column":0},"end":{"row":132,"column":0},"action":"insert","lines":["\t\t\t\t\t\t\t'Match this <<> and this <<here> please.',","\t\t\t\t\t\t\t'Match this MEDIUM_MATCH and this MEDIUM_MATCH please.',","",""],"id":304}],[{"start":{"row":132,"column":0},"end":{"row":135,"column":0},"action":"insert","lines":["\t\t\t\t\t\t\t'Match this <<> and this <<here> please.',","\t\t\t\t\t\t\t'Match this MEDIUM_MATCH and this MEDIUM_MATCH please.',","",""],"id":305}],[{"start":{"row":132,"column":21},"end":{"row":132,"column":22},"action":"insert","lines":["E"],"id":306}],[{"start":{"row":132,"column":22},"end":{"row":132,"column":23},"action":"insert","lines":["X"],"id":307}],[{"start":{"row":132,"column":23},"end":{"row":132,"column":24},"action":"insert","lines":["T"],"id":308}],[{"start":{"row":132,"column":24},"end":{"row":132,"column":25},"action":"insert","lines":["R"],"id":309}],[{"start":{"row":132,"column":25},"end":{"row":132,"column":26},"action":"insert","lines":["A"],"id":310}],[{"start":{"row":133,"column":36},"end":{"row":133,"column":37},"action":"insert","lines":["f"],"id":311}],[{"start":{"row":133,"column":37},"end":{"row":133,"column":38},"action":"insert","lines":["d"],"id":312}],[{"start":{"row":133,"column":38},"end":{"row":133,"column":39},"action":"insert","lines":["f"],"id":313}],[{"start":{"row":133,"column":39},"end":{"row":133,"column":40},"action":"insert","lines":["d"],"id":314}],[{"start":{"row":133,"column":39},"end":{"row":133,"column":40},"action":"remove","lines":["d"],"id":315}],[{"start":{"row":133,"column":38},"end":{"row":133,"column":39},"action":"remove","lines":["f"],"id":316}],[{"start":{"row":133,"column":37},"end":{"row":133,"column":38},"action":"remove","lines":["d"],"id":317}],[{"start":{"row":133,"column":36},"end":{"row":133,"column":37},"action":"remove","lines":["f"],"id":318}],[{"start":{"row":141,"column":0},"end":{"row":146,"column":0},"action":"remove","lines":["\t\t\t\t\t\tvar testPrecedent = loadPrecedentModule();","\t\t\t\t\t\ttestPrecedent.addPattern('<', '>', 'SHORTEST_MATCH');","\t\t\t\t\t\ttestPrecedent.addPattern('<<', '>', 'MEDIUM_MATCH');","\t\t\t\t\t\ttestPrecedent.addPattern('<<EXTRALONG', '>', 'EXTRA_LONG_MATCH');","",""],"id":319}],[{"start":{"row":141,"column":0},"end":{"row":142,"column":0},"action":"insert","lines":["",""],"id":320}],[{"start":{"row":125,"column":0},"end":{"row":130,"column":0},"action":"insert","lines":["\t\t\t\t\t\tvar testPrecedent = loadPrecedentModule();","\t\t\t\t\t\ttestPrecedent.addPattern('<', '>', 'SHORTEST_MATCH');","\t\t\t\t\t\ttestPrecedent.addPattern('<<', '>', 'MEDIUM_MATCH');","\t\t\t\t\t\ttestPrecedent.addPattern('<<EXTRALONG', '>', 'EXTRA_LONG_MATCH');","",""],"id":321}]]},"ace":{"folds":[],"scrolltop":1888,"scrollleft":0,"selection":{"start":{"row":137,"column":0},"end":{"row":137,"column":0},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":117,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1494778204529,"hash":"9ea3bac50037bf5f421fd8a25bc42108b8890140"}
{
"name": "precedent",
"version": "1.0.3",
"version": "1.0.4",
"description": "Precedent Meta-Templating",

@@ -5,0 +5,0 @@ "main": "source/Precedent.js",

@@ -46,81 +46,93 @@ /**

};
var parseString = (pString) =>
var newParserState = () =>
{
var tmpOutput = '';
var tmpOutputBuffer = '';
// This holds the currently matching pattern if there is one.
var tmpPattern = false;
// For sequential pattern matching.
var tmpPatternMatch = false;
var tmpPatternMatchOutputBuffer = '';
// Parse a character in the buffer
var parseCharacter = (pCharacter) =>
return (
{
// (1) If we aren't in a pattern match, and we aren't potentially matching, and this may be the start of a new pattern....
if (!tmpPattern && !tmpPatternMatch && _ParseTree.hasOwnProperty(pCharacter))
{
// (1) ... append the character directly to the Pattern Match output Buffer
tmpPatternMatch = _ParseTree[pCharacter];
tmpPatternMatchOutputBuffer += pCharacter;
}
// (2) If we are in a pattern match (actively seeing if this is part of a new pattern token)
else if (!tmpPattern && tmpPatternMatch)
{
// (2.a) If the pattern has a subpattern with this key
if (tmpPatternMatch.hasOwnProperty(pCharacter))
{
// (2.a) ... traverse another node on the tree.
tmpPatternMatch = tmpPatternMatch[pCharacter];
}
// (2.b) If the pattern has a END we can assume it has a parse function...
else if (tmpPatternMatch.hasOwnProperty('PatternEnd'))
{
// (2.b) ... this is the legitimate start of a pattern.
tmpPattern = tmpPatternMatch;
tmpPatternMatch = false;
Output: '',
OutputBuffer: '',
// Flush the output buffer.
tmpOutput += tmpOutputBuffer;
tmpOutputBuffer = '';
Pattern: false,
// Now parse this character (in PATTERN MODE)
parseCharacter(pCharacter);
}
// (2.c) This is a partial pattern start but doesn't actually have a valid end...
else
{
tmpPatternMatch = false;
tmpOutputBuffer += tmpPatternMatchOutputBuffer;
tmpPatternMatchOutputBuffer = '';
PatternMatch: false,
PatternMatchOutputBuffer: ''
});
};
// Assign a node as a possible parser state. If it is a valid complete closure, assign it as the current pattern.
var assignNode = (pNode, pParserState) =>
{
pParserState.PatternMatch = pNode;
// Now parse this character (back in RAW mode)
parseCharacter(pCharacter);
}
}
// (3) If we are in a pattern
else if (tmpPattern)
// If the pattern has a END we can assume it has a parse function...
if (pParserState.PatternMatch.hasOwnProperty('PatternEnd'))
{
// ... this is the legitimate start of a pattern.
pParserState.Pattern = pParserState.PatternMatch;
}
};
var appendOutputBuffer = (pCharacter, pParserState) =>
{
pParserState.OutputBuffer += pCharacter;
};
var flushOutputBuffer = (pParserState) =>
{
pParserState.Output += pParserState.OutputBuffer;
pParserState.OutputBuffer = '';
};
var checkPatternEnd = (pParserState) =>
{
if ((pParserState.OutputBuffer.length >= pParserState.Pattern.PatternEnd.length+pParserState.Pattern.PatternStart.length) &&
(pParserState.OutputBuffer.substr(-pParserState.Pattern.PatternEnd.length) === pParserState.Pattern.PatternEnd))
{
// ... this is the end of a pattern, cut off the end tag and parse it.
// Trim the start adn end tags off the output buffer now
pParserState.OutputBuffer = pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStart.length, pParserState.OutputBuffer.length - (pParserState.Pattern.PatternStart.length+pParserState.Pattern.PatternEnd.length)));
// Flush the output buffer.
flushOutputBuffer(pParserState);
// End pattern mode
pParserState.Pattern = false;
pParserState.PatternMatch = false;
}
};
// Parse a character in the buffer
var parseCharacter = (pCharacter, pParserState) =>
{
// (1) If we aren't in a pattern match, and we aren't potentially matching, and this may be the start of a new pattern....
if (!pParserState.PatternMatch && _ParseTree.hasOwnProperty(pCharacter))
{
// ... assign the node as the matched node.
assignNode(_ParseTree[pCharacter], pParserState);
appendOutputBuffer(pCharacter, pParserState);
}
// (2) If we are in a pattern match (actively seeing if this is part of a new pattern token)
else if (pParserState.PatternMatch)
{
// If the pattern has a subpattern with this key
if (pParserState.PatternMatch.hasOwnProperty(pCharacter))
{
// (3) ... append it to the output buffer.
tmpOutputBuffer += pCharacter;
// (3.a) ... Check if this is the end of the pattern...
if ((tmpOutputBuffer.length >= tmpPattern.PatternEnd.length) &&
(tmpOutputBuffer.substr(-tmpPattern.PatternEnd.length) === tmpPattern.PatternEnd))
{
// (3.a) ... ... this is the end of a pattern, cut off the end tag and parse it.
tmpOutput += tmpPattern.Parse(tmpOutputBuffer.substr(0, tmpOutputBuffer.length - tmpPattern.PatternEnd.length));
// End pattern mode, clear the output buffer.
tmpPattern = false;
tmpOutputBuffer = '';
}
// Continue matching patterns.
assignNode(pParserState.PatternMatch[pCharacter], pParserState);
}
// (2) If we aren't in a pattern match or pattern, and this isn't the start of a new pattern (RAW mode)....
else
appendOutputBuffer(pCharacter, pParserState);
if (pParserState.Pattern)
{
tmpOutputBuffer += pCharacter;
// ... Check if this is the end of the pattern (if we are matching a valid pattern)...
checkPatternEnd(pParserState);
}
};
}
// (3) If we aren't in a pattern match or pattern, and this isn't the start of a new pattern (RAW mode)....
else
{
pParserState.Output += pCharacter;
}
};
var parseString = (pString) =>
{
var tmpParserState = newParserState();

@@ -131,8 +143,8 @@

// TODO: This is not fast.
parseCharacter(pString[i]);
parseCharacter(pString[i], tmpParserState);
}
tmpOutput += tmpOutputBuffer;
flushOutputBuffer(tmpParserState);
return tmpOutput;
return tmpParserState.Output;
};

@@ -139,0 +151,0 @@

@@ -121,2 +121,39 @@ /**

);
test
(
'Identifier fallback...',
(fDone) =>
{
var testPrecedent = loadPrecedentModule();
testPrecedent.addPattern('<', '>', 'SHORTEST_MATCH');
testPrecedent.addPattern('<<', '>', 'MEDIUM_MATCH');
testPrecedent.addPattern('<<EXTRALONG', '>', 'EXTRA_LONG_MATCH');
var tmpTestStrings = [
'Match this <> and this <here> please.',
'Match this SHORTEST_MATCH and this SHORTEST_MATCH please.',
'Match this <<> and this <<here> please.',
'Match this MEDIUM_MATCH and this MEDIUM_MATCH please.',
'Match this <<EXTRA> and this <<here> please.',
'Match this MEDIUM_MATCH and this MEDIUM_MATCH please.',
'Match this <<EXTRALONG> and this <<here> please.',
'Match this EXTRA_LONG_MATCH and this MEDIUM_MATCH please.',
'Match this <<<<> and this <here> please.',
'Match this MEDIUM_MATCH and this SHORTEST_MATCH please.'
];
var tmpResult = '';
// Test every pair in TestStrings
for (var i = 0; i < tmpTestStrings.length; i+=2)
{
tmpResult = testPrecedent.parseString(tmpTestStrings[i]);
Expect(tmpResult).to.equal(tmpTestStrings[i+1]);
}
fDone();
}
);
}

@@ -123,0 +160,0 @@ );

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc