Skip to content

Commit

Permalink
add schema "virtual".
Browse files Browse the repository at this point in the history
  • Loading branch information
zswang authored and zswang committed Nov 5, 2015
1 parent 1f955fd commit c1b5bee
Show file tree
Hide file tree
Showing 25 changed files with 635 additions and 251 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jpacks",
"description": "Binary data packing and unpacking.",
"version": "0.3.13",
"version": "0.3.15",
"homepage": "https://github.com/zswang/jpacks",
"authors": {
"name": "zswang",
Expand Down
35 changes: 15 additions & 20 deletions example.jdists.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,18 @@ forEach(function (item) {
});
/*</jdists>*/

<!--jdists export="#pattern">/^\s*\*\s*@example\s*(.*)$/mg</jdists-->
<!--jdists export="#replacement"> it("$1", function () {</jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->

<!--jdists export="#pattern">/^\s*```js\s*$/mg</jdists-->
<!--jdists export="#replacement"></jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->

<!--jdists export="#pattern">/^\s*```\s*$/mg</jdists-->
<!--jdists export="#replacement"> });</jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->

<!--jdists export="#pattern">/console\.log/g</jdists-->
<!--jdists export="#replacement">print</jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->

<!--jdists export="#pattern">/\/\/ -?>\s*(.*)/gm</jdists-->
<!--jdists export="#replacement">assert.equal(printValue, '$1'); printValue = undefined;</jdists-->
<!--jdists encoding="regex" import="#example" pattern="#pattern" replacement="#replacement" export="#example" /-->
/*<jdists import="#example"/>*/
/*<jdists export="#replacer">*/
function (content) {
content = content.replace(/^\s*\*\s*@example\s*(.*)$/mg,
' it("$1", function () {');
content = content.replace(/^\s*```js\s*$/mg, '');
content = content.replace(/\/\/ -?>\s*(.*)/gm, function (all, output) {
return ' assert.equal(printValue, ' + JSON.stringify(output) + '); printValue = undefined;'
});
content = content.replace(/console\.log/g, 'print');
content = content.replace(/^\s*```\s*$/mg,
' });');
return content;
}
/*</jdists>*/
/*<jdists encoding="#replacer" import="#example"/>*/
Loading

0 comments on commit c1b5bee

Please sign in to comment.