summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-smarty.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/prism/prism-smarty.min.js')
-rw-r--r--public/prism/prism-smarty.min.js94
1 files changed, 94 insertions, 0 deletions
diff --git a/public/prism/prism-smarty.min.js b/public/prism/prism-smarty.min.js
new file mode 100644
index 0000000..8c85b65
--- /dev/null
+++ b/public/prism/prism-smarty.min.js
@@ -0,0 +1,94 @@
+!(function (t) {
+ (t.languages.smarty = {
+ comment: { pattern: /^\{\*[\s\S]*?\*\}/, greedy: !0 },
+ 'embedded-php': {
+ pattern: /^\{php\}[\s\S]*?\{\/php\}/,
+ greedy: !0,
+ inside: {
+ smarty: { pattern: /^\{php\}|\{\/php\}$/, inside: null },
+ php: {
+ pattern: /[\s\S]+/,
+ alias: 'language-php',
+ inside: t.languages.php,
+ },
+ },
+ },
+ string: [
+ {
+ pattern: /"(?:\\.|[^"\\\r\n])*"/,
+ greedy: !0,
+ inside: {
+ interpolation: {
+ pattern: /\{[^{}]*\}|`[^`]*`/,
+ inside: {
+ 'interpolation-punctuation': {
+ pattern: /^[{`]|[`}]$/,
+ alias: 'punctuation',
+ },
+ expression: { pattern: /[\s\S]+/, inside: null },
+ },
+ },
+ variable: /\$\w+/,
+ },
+ },
+ { pattern: /'(?:\\.|[^'\\\r\n])*'/, greedy: !0 },
+ ],
+ keyword: {
+ pattern: /(^\{\/?)[a-z_]\w*\b(?!\()/i,
+ lookbehind: !0,
+ greedy: !0,
+ },
+ delimiter: { pattern: /^\{\/?|\}$/, greedy: !0, alias: 'punctuation' },
+ number: /\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,
+ variable: [
+ /\$(?!\d)\w+/,
+ /#(?!\d)\w+#/,
+ { pattern: /(\.|->|\w\s*=)(?!\d)\w+\b(?!\()/, lookbehind: !0 },
+ { pattern: /(\[)(?!\d)\w+(?=\])/, lookbehind: !0 },
+ ],
+ function: {
+ pattern: /(\|\s*)@?[a-z_]\w*|\b[a-z_]\w*(?=\()/i,
+ lookbehind: !0,
+ },
+ 'attr-name': /\b[a-z_]\w*(?=\s*=)/i,
+ boolean: /\b(?:false|no|off|on|true|yes)\b/,
+ punctuation: /[\[\](){}.,:`]|->/,
+ operator: [
+ /[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,
+ /\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,
+ /\b(?:and|eq|gt?e|gt|lt?e|lt|mod|neq?|not|or)\b/,
+ ],
+ }),
+ (t.languages.smarty['embedded-php'].inside.smarty.inside =
+ t.languages.smarty),
+ (t.languages.smarty.string[0].inside.interpolation.inside.expression.inside =
+ t.languages.smarty);
+ var e = /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,
+ a = RegExp(
+ '\\{\\*[^]*?\\*\\}|\\{php\\}[^]*?\\{/php\\}|' +
+ '\\{(?:[^{}"\']|<str>|\\{(?:[^{}"\']|<str>|\\{(?:[^{}"\']|<str>)*\\})*\\})*\\}'.replace(
+ /<str>/g,
+ function () {
+ return e.source;
+ }
+ ),
+ 'g'
+ );
+ t.hooks.add('before-tokenize', function (e) {
+ var n = !1;
+ t.languages['markup-templating'].buildPlaceholders(
+ e,
+ 'smarty',
+ a,
+ function (e) {
+ return (
+ '{/literal}' === e && (n = !1),
+ !n && ('{literal}' === e && (n = !0), !0)
+ );
+ }
+ );
+ }),
+ t.hooks.add('after-tokenize', function (e) {
+ t.languages['markup-templating'].tokenizePlaceholders(e, 'smarty');
+ });
+})(Prism);