59e94a0353ed5ab0c861fd6b620c398b5d8b8ec603a935411414407b89fb6b2f.json 5.2 KB

1
  1. {"ast":null,"code":"/*\nLanguage: Leaf\nDescription: A Swift-based templating language created for the Vapor project.\nWebsite: https://docs.vapor.codes/leaf/overview\nCategory: template\n*/\n\nfunction leaf(hljs) {\n const IDENT = /([A-Za-z_][A-Za-z_0-9]*)?/;\n const LITERALS = ['true', 'false', 'in'];\n const PARAMS = {\n scope: 'params',\n begin: /\\(/,\n end: /\\)(?=\\:?)/,\n endsParent: true,\n relevance: 7,\n contains: [{\n scope: 'string',\n begin: '\"',\n end: '\"'\n }, {\n scope: 'keyword',\n match: LITERALS.join(\"|\")\n }, {\n scope: 'variable',\n match: /[A-Za-z_][A-Za-z_0-9]*/\n }, {\n scope: 'operator',\n match: /\\+|\\-|\\*|\\/|\\%|\\=\\=|\\=|\\!|\\>|\\<|\\&\\&|\\|\\|/\n }]\n };\n const INSIDE_DISPATCH = {\n match: [IDENT, /(?=\\()/],\n scope: {\n 1: \"keyword\"\n },\n contains: [PARAMS]\n };\n PARAMS.contains.unshift(INSIDE_DISPATCH);\n return {\n name: 'Leaf',\n contains: [\n // #ident():\n {\n match: [/#+/, IDENT, /(?=\\()/],\n scope: {\n 1: \"punctuation\",\n 2: \"keyword\"\n },\n // will start up after the ending `)` match from line ~44\n // just to grab the trailing `:` if we can match it\n starts: {\n contains: [{\n match: /\\:/,\n scope: \"punctuation\"\n }]\n },\n contains: [PARAMS]\n },\n // #ident or #ident:\n {\n match: [/#+/, IDENT, /:?/],\n scope: {\n 1: \"punctuation\",\n 2: \"keyword\",\n 3: \"punctuation\"\n }\n }]\n };\n}\nmodule.exports = leaf;","map":{"version":3,"names":["leaf","hljs","IDENT","LITERALS","PARAMS","scope","begin","end","endsParent","relevance","contains","match","join","INSIDE_DISPATCH","unshift","name","starts","module","exports"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/highlight.js/lib/languages/leaf.js"],"sourcesContent":["/*\nLanguage: Leaf\nDescription: A Swift-based templating language created for the Vapor project.\nWebsite: https://docs.vapor.codes/leaf/overview\nCategory: template\n*/\n\nfunction leaf(hljs) {\n const IDENT = /([A-Za-z_][A-Za-z_0-9]*)?/;\n const LITERALS = [\n 'true',\n 'false',\n 'in'\n ];\n const PARAMS = {\n scope: 'params',\n begin: /\\(/,\n end: /\\)(?=\\:?)/,\n endsParent: true,\n relevance: 7,\n contains: [\n {\n scope: 'string',\n begin: '\"',\n end: '\"'\n },\n {\n scope: 'keyword',\n match: LITERALS.join(\"|\"),\n },\n {\n scope: 'variable',\n match: /[A-Za-z_][A-Za-z_0-9]*/\n },\n {\n scope: 'operator',\n match: /\\+|\\-|\\*|\\/|\\%|\\=\\=|\\=|\\!|\\>|\\<|\\&\\&|\\|\\|/\n }\n ]\n };\n const INSIDE_DISPATCH = {\n match: [\n IDENT,\n /(?=\\()/,\n ],\n scope: {\n 1: \"keyword\"\n },\n contains: [ PARAMS ]\n };\n PARAMS.contains.unshift(INSIDE_DISPATCH);\n return {\n name: 'Leaf',\n contains: [\n // #ident():\n {\n match: [\n /#+/,\n IDENT,\n /(?=\\()/,\n ],\n scope: {\n 1: \"punctuation\",\n 2: \"keyword\"\n },\n // will start up after the ending `)` match from line ~44\n // just to grab the trailing `:` if we can match it\n starts: {\n contains: [\n {\n match: /\\:/,\n scope: \"punctuation\"\n }\n ]\n },\n contains: [\n PARAMS\n ],\n },\n // #ident or #ident:\n {\n match: [\n /#+/,\n IDENT,\n /:?/,\n ],\n scope: {\n 1: \"punctuation\",\n 2: \"keyword\",\n 3: \"punctuation\"\n }\n },\n ]\n };\n}\n\nmodule.exports = leaf;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAIA,CAACC,IAAI,EAAE;EAClB,MAAMC,KAAK,GAAG,2BAA2B;EACzC,MAAMC,QAAQ,GAAG,CACf,MAAM,EACN,OAAO,EACP,IAAI,CACL;EACD,MAAMC,MAAM,GAAG;IACbC,KAAK,EAAE,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"metadata":{},"sourceType":"script","externalDependencies":[]}