Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit ad8324d

Browse files
committed
comment on engine support level and cleanup
1 parent cfa2aaf commit ad8324d

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

builder/pattern_engines/engine_handlebars.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
*
99
*/
1010

11+
/*
12+
* ENGINE SUPPORT LEVEL:
13+
*
14+
* Full. Partial calls and lineage hunting are supported. Handlebars does not
15+
* support the mustache-specific syntax extensions, style modifiers and pattern
16+
* parameters, because their use cases are addressed by the core Handlebars
17+
* feature set.
18+
*
19+
*/
20+
1121
(function () {
1222
"use strict";
1323

@@ -23,11 +33,7 @@
2333
expandPartials: false,
2434

2535
// regexes, stored here so they're only compiled once
26-
// GTP warning: unchanged copypasta from mustache engine
27-
// findPartialsRE: /{{>\s*((?:\d+-[\w-]+\/)+(\d+-[\w-]+(\.\w+)?)|[A-Za-z0-9-]+)(\:[\w-]+)?(\(\s*\w+\s*:\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")\))?\s*}}/g,
2836
findPartialsRE: /{{#?>\s*([\w-\/.]+)(?:.|\s+)*?}}/g,
29-
findPartialsWithStyleModifiersRE: /{{>([ ])?([\w\-\.\/~]+)(?!\()(\:[A-Za-z0-9-_|]+)+(?:(| )\(.*)?([ ])?}}/g,
30-
findPartialsWithPatternParametersRE: /{{>([ ])?([\w\-\.\/~]+)(?:\:[A-Za-z0-9-_|]+)?(?:(| )\(.*)+([ ])?}}/g,
3137
findListItemsRE: /({{#( )?)(list(I|i)tems.)(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)( )?}}/g,
3238

3339
// render it
@@ -48,15 +54,17 @@
4854
var matches = pattern.template.match(this.findPartialsRE);
4955
return matches;
5056
},
51-
findPartialsWithStyleModifiers: function(pattern) {
52-
var matches = pattern.template.match(this.findPartialsWithStyleModifiersRE);
53-
return matches;
57+
findPartialsWithStyleModifiers: function() {
58+
// TODO: make the call to this from oPattern objects conditional on their
59+
// being implemented here.
60+
return [];
5461
},
5562
// returns any patterns that match {{> value(foo:"bar") }} or {{>
5663
// value:mod(foo:"bar") }} within the pattern
57-
findPartialsWithPatternParameters: function(pattern) {
58-
var matches = pattern.template.match(this.findPartialsWithPatternParametersRE);
59-
return matches;
64+
findPartialsWithPatternParameters: function() {
65+
// TODO: make the call to this from oPattern objects conditional on their
66+
// being implemented here.
67+
return [];
6068
},
6169
findListItems: function(pattern) {
6270
var matches = pattern.template.match(this.findListItemsRE);

builder/pattern_engines/engine_mustache.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
*
99
*/
1010

11+
/*
12+
* ENGINE SUPPORT LEVEL:
13+
*
14+
* Full + extensions. Partial calls and lineage hunting are supported. Style
15+
* modifiers and pattern parameters are used to extend the core feature set of
16+
* Mustache templates.
17+
*
18+
*/
19+
1120
(function () {
1221
"use strict";
1322

0 commit comments

Comments
 (0)