@handlebars/parser
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -0,1 +1,9 @@ | ||
## v2.1.0 (2021-02-22) | ||
#### :rocket: Enhancement | ||
* [#4](https://github.com/handlebars-lang/handlebars-parser/pull/4) [FEATURE] Allows SubExpressions to be PathExpression roots ([@pzuraq](https://github.com/pzuraq)) | ||
#### Committers: 1 | ||
- Chris Garrett ([@pzuraq](https://github.com/pzuraq)) | ||
## v2.0.0 (2020-12-09) | ||
@@ -2,0 +10,0 @@ |
"use strict"; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -47,5 +54,16 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.stripComment = stripComment; | ||
function preparePath(data, parts, loc) { | ||
function preparePath(data, sexpr, parts, loc) { | ||
loc = this.locInfo(loc); | ||
var original = data ? '@' : '', dig = [], depth = 0; | ||
var original; | ||
if (data) { | ||
original = '@'; | ||
} | ||
else if (sexpr) { | ||
original = sexpr.original + '.'; | ||
} | ||
else { | ||
original = ''; | ||
} | ||
var tail = []; | ||
var depth = 0; | ||
for (var i = 0, l = parts.length; i < l; i++) { | ||
@@ -58,3 +76,3 @@ var part = parts[i].part, | ||
if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { | ||
if (dig.length > 0) { | ||
if (tail.length > 0) { | ||
throw new exception_1.default('Invalid path: ' + original, { loc: loc }); | ||
@@ -67,5 +85,6 @@ } | ||
else { | ||
dig.push(part); | ||
tail.push(part); | ||
} | ||
} | ||
var head = sexpr || tail.shift(); | ||
return { | ||
@@ -75,3 +94,5 @@ type: 'PathExpression', | ||
depth: depth, | ||
parts: dig, | ||
head: head, | ||
tail: tail, | ||
parts: __spreadArrays([head], tail), | ||
original: original, | ||
@@ -195,2 +216,2 @@ loc: loc | ||
exports.preparePartialBlock = preparePartialBlock; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9oZWxwZXJzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLDBEQUFvQztBQUVwQyxTQUFTLGFBQWEsQ0FBQyxJQUFJLEVBQUUsS0FBSztJQUNoQyxLQUFLLEdBQUcsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQztJQUVqRCxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxLQUFLLEtBQUssRUFBRTtRQUNoQyxJQUFJLFNBQVMsR0FBRyxFQUFFLEdBQUcsRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBRXZDLE1BQU0sSUFBSSxtQkFBUyxDQUNqQixJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsR0FBRyxpQkFBaUIsR0FBRyxLQUFLLEVBQzlDLFNBQVMsQ0FDVixDQUFDO0tBQ0g7QUFDSCxDQUFDO0FBRUQsU0FBZ0IsY0FBYyxDQUFDLE1BQU0sRUFBRSxPQUFPO0lBQzVDLElBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDO0lBQ3JCLElBQUksQ0FBQyxLQUFLLEdBQUc7UUFDWCxJQUFJLEVBQUUsT0FBTyxDQUFDLFVBQVU7UUFDeEIsTUFBTSxFQUFFLE9BQU8sQ0FBQyxZQUFZO0tBQzdCLENBQUM7SUFDRixJQUFJLENBQUMsR0FBRyxHQUFHO1FBQ1QsSUFBSSxFQUFFLE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W5idWwgaWdub3JlIGVsc2UgKi9cbiAgICBpZiAoZmlyc3RMb2MgJiYgbGFzdExvYykge1xuICAgICAgbG9jID0ge1xuICAgICAgICBzb3VyY2U6IGZpcnN0TG9jLnNvdXJjZSxcbiAgICAgICAgc3RhcnQ6IHtcbiAgICAgICAgICBsaW5lOiBmaXJzdExvYy5zdGFydC5saW5lLFxuICAgICAgICAgIGNvbHVtbjogZmlyc3RMb2Muc3RhcnQuY29sdW1uXG4gICAgICAgIH0sXG4gICAgICAgIGVuZDoge1xuICAgICAgICAgIGxpbmU6IGxhc3RMb2MuZW5kLmxpbmUsXG4gICAgICAgICAgY29sdW1uOiBsYXN0TG9jLmVuZC5jb2x1bW5cbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4ge1xuICAgIHR5cGU6ICdQcm9ncmFtJyxcbiAgICBib2R5OiBzdGF0ZW1lbnRzLFxuICAgIHN0cmlwOiB7fSxcbiAgICBsb2M6IGxvY1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcHJlcGFyZVBhcnRpYWxCbG9jayhvcGVuLCBwcm9ncmFtLCBjbG9zZSwgbG9jSW5mbykge1xuICB2YWxpZGF0ZUNsb3NlKG9wZW4sIGNsb3NlKTtcblxuICByZXR1cm4ge1xuICAgIHR5cGU6ICdQYXJ0aWFsQmxvY2tTdGF0ZW1lbnQnLFxuICAgIG5hbWU6IG9wZW4ucGF0aCxcbiAgICBwYXJhbXM6IG9wZW4ucGFyYW1zLFxuICAgIGhhc2g6IG9wZW4uaGFzaCxcbiAgICBwcm9ncmFtLFxuICAgIG9wZW5TdHJpcDogb3Blbi5zdHJpcCxcbiAgICBjbG9zZVN0cmlwOiBjbG9zZSAmJiBjbG9zZS5zdHJpcCxcbiAgICBsb2M6IHRoaXMubG9jSW5mbyhsb2NJbmZvKVxuICB9O1xufVxuIl19 |
"use strict"; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -114,3 +121,4 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
PrintVisitor.prototype.PathExpression = function (id) { | ||
var path = id.parts.join('/'); | ||
var head = typeof id.head === 'string' ? id.head : "[" + this.accept(id.head) + "]"; | ||
var path = __spreadArrays([head], id.tail).join('/'); | ||
return (id.data ? '@' : '') + 'PATH:' + path; | ||
@@ -144,2 +152,2 @@ }; | ||
/* eslint-enable new-cap */ | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpbnRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9wcmludGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLDRCQUE0QjtBQUM1QixzREFBZ0M7QUFFaEMsU0FBZ0IsS0FBSyxDQUFDLEdBQUc7SUFDdkIsT0FBTyxJQUFJLFlBQVksRUFBRSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUN4QyxDQUFDO0FBRkQsc0JBRUM7QUFFRCxTQUFnQixZQUFZO0lBQzFCLElBQUksQ0FBQyxPQUFPLEdBQUcsQ0FBQyxDQUFDO0FBQ25CLENBQUM7QUFGRCxvQ0FFQztBQUVELFlBQVksQ0FBQyxTQUFTLEdBQUcsSUFBSSxpQkFBTyxFQUFFLENBQUM7QUFFdkMsWUFBWSxDQUFDLFNBQVMsQ0FBQyxHQUFHLEdBQUcsVUFBUyxNQUFNO0lBQzFDLElBQUksR0FBRyxHQUFHLEVBQUUsQ0FBQztJQUViLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFF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SArICd9Jztcbn07XG5QcmludFZpc2l0b3IucHJvdG90eXBlLkhhc2hQYWlyID0gZnVuY3Rpb24ocGFpcikge1xuICByZXR1cm4gcGFpci5rZXkgKyAnPScgKyB0aGlzLmFjY2VwdChwYWlyLnZhbHVlKTtcbn07XG4vKiBlc2xpbnQtZW5hYmxlIG5ldy1jYXAgKi9cbiJdfQ== |
@@ -0,1 +1,8 @@ | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
import Exception from './exception'; | ||
@@ -37,5 +44,16 @@ function validateClose(open, close) { | ||
} | ||
export function preparePath(data, parts, loc) { | ||
export function preparePath(data, sexpr, parts, loc) { | ||
loc = this.locInfo(loc); | ||
var original = data ? '@' : '', dig = [], depth = 0; | ||
var original; | ||
if (data) { | ||
original = '@'; | ||
} | ||
else if (sexpr) { | ||
original = sexpr.original + '.'; | ||
} | ||
else { | ||
original = ''; | ||
} | ||
var tail = []; | ||
var depth = 0; | ||
for (var i = 0, l = parts.length; i < l; i++) { | ||
@@ -48,3 +66,3 @@ var part = parts[i].part, | ||
if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { | ||
if (dig.length > 0) { | ||
if (tail.length > 0) { | ||
throw new Exception('Invalid path: ' + original, { loc: loc }); | ||
@@ -57,5 +75,6 @@ } | ||
else { | ||
dig.push(part); | ||
tail.push(part); | ||
} | ||
} | ||
var head = sexpr || tail.shift(); | ||
return { | ||
@@ -65,3 +84,5 @@ type: 'PathExpression', | ||
depth: depth, | ||
parts: dig, | ||
head: head, | ||
tail: tail, | ||
parts: __spreadArrays([head], tail), | ||
original: original, | ||
@@ -179,2 +200,2 @@ loc: loc | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIj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MuZW5kLmxpbmUsXG4gICAgICAgICAgY29sdW1uOiBsYXN0TG9jLmVuZC5jb2x1bW5cbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4ge1xuICAgIHR5cGU6ICdQcm9ncmFtJyxcbiAgICBib2R5OiBzdGF0ZW1lbnRzLFxuICAgIHN0cmlwOiB7fSxcbiAgICBsb2M6IGxvY1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcHJlcGFyZVBhcnRpYWxCbG9jayhvcGVuLCBwcm9ncmFtLCBjbG9zZSwgbG9jSW5mbykge1xuICB2YWxpZGF0ZUNsb3NlKG9wZW4sIGNsb3NlKTtcblxuICByZXR1cm4ge1xuICAgIHR5cGU6ICdQYXJ0aWFsQmxvY2tTdGF0ZW1lbnQnLFxuICAgIG5hbWU6IG9wZW4ucGF0aCxcbiAgICBwYXJhbXM6IG9wZW4ucGFyYW1zLFxuICAgIGhhc2g6IG9wZW4uaGFzaCxcbiAgICBwcm9ncmFtLFxuICAgIG9wZW5TdHJpcDogb3Blbi5zdHJpcCxcbiAgICBjbG9zZVN0cmlwOiBjbG9zZSAmJiBjbG9zZS5zdHJpcCxcbiAgICBsb2M6IHRoaXMubG9jSW5mbyhsb2NJbmZvKVxuICB9O1xufVxuIl19 |
@@ -0,1 +1,8 @@ | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
}; | ||
/* eslint-disable new-cap */ | ||
@@ -106,3 +113,4 @@ import Visitor from './visitor'; | ||
PrintVisitor.prototype.PathExpression = function (id) { | ||
var path = id.parts.join('/'); | ||
var head = typeof id.head === 'string' ? id.head : "[" + this.accept(id.head) + "]"; | ||
var path = __spreadArrays([head], id.tail).join('/'); | ||
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aW50VmlzaXRvci5wcm90b3R5cGUuQm9vbGVhbkxpdGVyYWwgPSBmdW5jdGlvbihib29sKSB7XG4gIHJldHVybiAnQk9PTEVBTnsnICsgYm9vbC52YWx1ZSArICd9Jztcbn07XG5cblByaW50VmlzaXRvci5wcm90b3R5cGUuVW5kZWZpbmVkTGl0ZXJhbCA9IGZ1bmN0aW9uKCkge1xuICByZXR1cm4gJ1VOREVGSU5FRCc7XG59O1xuXG5QcmludFZpc2l0b3IucHJvdG90eXBlLk51bGxMaXRlcmFsID0gZnVuY3Rpb24oKSB7XG4gIHJldHVybiAnTlVMTCc7XG59O1xuXG5QcmludFZpc2l0b3IucHJvdG90eXBlLkhhc2ggPSBmdW5jdGlvbihoYXNoKSB7XG4gIGxldCBwYWlycyA9IGhhc2gucGFpcnMsXG4gICAgam9pbmVkUGFpcnMgPSBbXTtcblxuICBmb3IgKGxldCBpID0gMCwgbCA9IHBhaXJzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgIGpvaW5lZFBhaXJzLnB1c2godGhpcy5hY2NlcHQocGFpcnNbaV0pKTtcbiAgfVxuXG4gIHJldHVybiAnSEFTSHsnICsgam9pbmVkUGFpcnMuam9pbignLCAnKSArICd9Jztcbn07XG5QcmludFZpc2l0b3IucHJvdG90eXBlLkhhc2hQYWlyID0gZnVuY3Rpb24ocGFpcikge1xuICByZXR1cm4gcGFpci5rZXkgKyAnPScgKyB0aGlzLmFjY2VwdChwYWlyLnZhbHVlKTtcbn07XG4vKiBlc2xpbnQtZW5hYmxlIG5ldy1jYXAgKi9cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpbnRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9wcmludGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQSw0QkFBNEI7QUFDNUIsT0FBTyxPQUFPLE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W1iZXIpIHtcbiAgcmV0dXJuICdOVU1CRVJ7JyArIG51bWJlci52YWx1ZSArICd9Jztcbn07XG5cblByaW50VmlzaXRvci5wcm90b3R5cGUuQm9vbGVhbkxpdGVyYWwgPSBmdW5jdGlvbihib29sKSB7XG4gIHJldHVybiAnQk9PTEVBTnsnICsgYm9vbC52YWx1ZSArICd9Jztcbn07XG5cblByaW50VmlzaXRvci5wcm90b3R5cGUuVW5kZWZpbmVkTGl0ZXJhbCA9IGZ1bmN0aW9uKCkge1xuICByZXR1cm4gJ1VOREVGSU5FRCc7XG59O1xuXG5QcmludFZpc2l0b3IucHJvdG90eXBlLk51bGxMaXRlcmFsID0gZnVuY3Rpb24oKSB7XG4gIHJldHVybiAnTlVMTCc7XG59O1xuXG5QcmludFZpc2l0b3IucHJvdG90eXBlLkhhc2ggPSBmdW5jdGlvbihoYXNoKSB7XG4gIGxldCBwYWlycyA9IGhhc2gucGFpcnMsXG4gICAgam9pbmVkUGFpcnMgPSBbXTtcblxuICBmb3IgKGxldCBpID0gMCwgbCA9IHBhaXJzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgIGpvaW5lZFBhaXJzLnB1c2godGhpcy5hY2NlcHQocGFpcnNbaV0pKTtcbiAgfVxuXG4gIHJldHVybiAnSEFTSHsnICsgam9pbmVkUGFpcnMuam9pbignLCAnKSArICd9Jztcbn07XG5QcmludFZpc2l0b3IucHJvdG90eXBlLkhhc2hQYWlyID0gZnVuY3Rpb24ocGFpcikge1xuICByZXR1cm4gcGFpci5rZXkgKyAnPScgKyB0aGlzLmFjY2VwdChwYWlyLnZhbHVlKTtcbn07XG4vKiBlc2xpbnQtZW5hYmxlIG5ldy1jYXAgKi9cbiJdfQ== |
@@ -47,9 +47,18 @@ import Exception from './exception'; | ||
export function preparePath(data, parts, loc) { | ||
export function preparePath(data, sexpr, parts, loc) { | ||
loc = this.locInfo(loc); | ||
let original = data ? '@' : '', | ||
dig = [], | ||
depth = 0; | ||
let original; | ||
if (data) { | ||
original = '@'; | ||
} else if (sexpr) { | ||
original = sexpr.original + '.'; | ||
} else { | ||
original = ''; | ||
} | ||
let tail = []; | ||
let depth = 0; | ||
for (let i = 0, l = parts.length; i < l; i++) { | ||
@@ -63,3 +72,3 @@ let part = parts[i].part, | ||
if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { | ||
if (dig.length > 0) { | ||
if (tail.length > 0) { | ||
throw new Exception('Invalid path: ' + original, { loc }); | ||
@@ -70,6 +79,8 @@ } else if (part === '..') { | ||
} else { | ||
dig.push(part); | ||
tail.push(part); | ||
} | ||
} | ||
let head = sexpr || tail.shift(); | ||
return { | ||
@@ -79,3 +90,5 @@ type: 'PathExpression', | ||
depth, | ||
parts: dig, | ||
head, | ||
tail, | ||
parts: [head, ...tail], | ||
original, | ||
@@ -82,0 +95,0 @@ loc |
@@ -141,3 +141,4 @@ /* eslint-disable new-cap */ | ||
PrintVisitor.prototype.PathExpression = function(id) { | ||
let path = id.parts.join('/'); | ||
let head = typeof id.head === 'string' ? id.head : `[${this.accept(id.head)}]`; | ||
let path = [head, ...id.tail].join('/'); | ||
return (id.data ? '@' : '') + 'PATH:' + path; | ||
@@ -144,0 +145,0 @@ }; |
{ | ||
"name": "@handlebars/parser", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "The parser for the Handlebars language", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/handlebars-lang/handlebars-parser#readme", |
@@ -320,2 +320,30 @@ import { parse, print } from '../dist/esm'; | ||
it('parses paths with sub-expressions as the root', function() { | ||
equals( | ||
astFor('{{(my-helper foo).bar}}'), | ||
'{{ PATH:[PATH:my-helper [PATH:foo]]/bar [] }}\n' | ||
); | ||
}); | ||
it('parses paths with sub-expressions as the root as a callable', function() { | ||
equals( | ||
astFor('{{((my-helper foo).bar baz)}}'), | ||
'{{ PATH:[PATH:my-helper [PATH:foo]]/bar [PATH:baz] [] }}\n' | ||
); | ||
}); | ||
it('parses paths with sub-expressions as the root as an argument', function() { | ||
equals( | ||
astFor('{{(foo (my-helper bar).baz)}}'), | ||
'{{ PATH:foo [PATH:[PATH:my-helper [PATH:bar]]/baz] [] }}\n' | ||
); | ||
}); | ||
it('parses paths with sub-expressions as the root as a named argument', function() { | ||
equals( | ||
astFor('{{(foo bar=(my-helper baz).qux)}}'), | ||
'{{ PATH:foo [] HASH{bar=PATH:[PATH:my-helper [PATH:baz]]/qux} [] }}\n' | ||
); | ||
}); | ||
it('parses inverse block with block params', function() { | ||
@@ -322,0 +350,0 @@ equals( |
@@ -93,3 +93,5 @@ export interface Node { | ||
depth: number; | ||
parts: string[]; | ||
parts: (string | SubExpression)[]; | ||
head: SubExpression | string; | ||
tail: string[]; | ||
original: string; | ||
@@ -96,0 +98,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
595341
5179