@awesome-fe/translate
Version:
Translation utils
23 lines • 715 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.anchorTokenizer = void 0;
function anchorTokenizer(eat, value, silent) {
var matches = /^{@a (.*?)}/.exec(value);
if (matches) {
try {
if (silent || !matches) {
// either we are not eating (silent) or the match failed
return !!matches;
}
return eat(matches[0])({
type: 'anchor',
name: matches[1],
});
}
catch (e) {
this.file.fail('Unmatched anchor tag: ' + e.message);
}
}
}
exports.anchorTokenizer = anchorTokenizer;
//# sourceMappingURL=anchor-tokenizer.js.map