1
|
{"version":3,"sources":["webpack:///./node_modules/highlight.js/lib/languages/elixir.js"],"names":["module","exports","hljs","ELIXIR_IDENT_RE","ELIXIR_KEYWORDS","$pattern","keyword","SUBST","className","begin","end","keywords","NUMBER","relevance","LOWERCASE_SIGIL","contains","endsParent","BACKSLASH_ESCAPE","variants","UPCASE_SIGIL","STRING","FUNCTION","beginKeywords","inherit","TITLE_MODE","CLASS","ELIXIR_DEFAULT_CONTAINS","HASH_COMMENT_MODE","RE_STARTERS_RE","illegal","name"],"mappings":"mGAkQAA,EAAOC,QAzPP,SAAgBC,GACd,IAAMC,EAAkB,kCAElBC,EAAkB,CACtBC,SAAUF,EACVG,QAAS,uMAILC,EAAQ,CACZC,UAAW,QACXC,MAAO,MACPC,IAAK,KACLC,SAAUP,GAENQ,EAAS,CACbJ,UAAW,SACXC,MAAO,uGACPI,UAAW,GAGPC,EAAkB,CACtBN,UAAW,SACXC,MAAO,wBACPM,SAAU,CACR,CACEC,YAAY,EACZD,SAAU,CACR,CACEA,SAAU,CACRb,EAAKe,iBACLV,GAEFW,SAAU,CACR,CACET,MAAO,IACPC,IAAK,KAEP,CACED,MAAO,IACPC,IAAK,KAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,IACPC,IAAK,WASbS,EAAe,CACnBX,UAAW,SACXC,MAAO,wBACPM,SAAU,CACR,CACEN,MAAO,IACPC,IAAK,KAEP,CACED,MAAO,IACPC,IAAK,KAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,KACPC,IAAK,MAEP,CACED,MAAO,IACPC,IAAK,OAKLU,EAAS,CACbZ,UAAW,SACXO,SAAU,CACRb,EAAKe,iBACLV,GAEFW,SAAU,CACR,CACET,MAAO,MACPC,IAAK,OAEP,CACED,MAAO,MACPC,IAAK,OAEP,CACED,MAAO,QACPC,IAAK,MACLK,SAAU,IAEZ,CACEN,MAAO,MACPC,IAAK,IACLK,SAAU,IAEZ,CACEN,MAAO,QACPC,IAAK,MACLK,SAAU,IAEZ,CACEN,MAAO,MACPC,IAAK,IACLK,SAAU,IAEZ,CACEN,MAAO,IACPC,IAAK,KAEP,CACED,MAAO,IACPC,IAAK,OAILW,EAAW,CACfb,UAAW,WACXc,cAAe,oBACfZ,IAAK,OACLK,SAAU,CACRb,EAAKqB,QAAQrB,EAAKsB,WAAY,CAC5Bf,MAAON,EACPa,YAAY,MAIZS,EAAQvB,EAAKqB,QAAQF,EAAU,CACnCb,UAAW,QACXc,cAAe,0CACfZ,IAAK,eAEDgB,EAA0B,CAC9BN,EACAD,EACAL,EACAZ,EAAKyB,kBACLF,EACAJ,EACA,CACEZ,MAAO,MAET,CACED,UAAW,SACXC,MAAO,cACPM,SAAU,CACRK,EACA,CACEX,MA3LiB,qFA8LrBI,UAAW,GAEb,CACEL,UAAW,SACXC,MAAON,EAAkB,SACzBU,UAAW,GAEbD,EACA,CACEJ,UAAW,WACXC,MAAO,8BAET,CACEA,MAAO,MAET,CACEA,MAAO,IAAMP,EAAK0B,eAAiB,QACnCb,SAAU,CACRb,EAAKyB,kBACL,CAGElB,MAAO,sBACPI,UAAW,EACXE,SAAU,CAACH,IAEb,CACEJ,UAAW,SACXqB,QAAS,MACTd,SAAU,CACRb,EAAKe,iBACLV,GAEFW,SAAU,CACR,CACET,MAAO,IACPC,IAAK,WAEP,CACED,MAAO,QACPC,IAAK,gBAKbG,UAAW,IAKf,OAFAN,EAAMQ,SAAWW,EAEV,CACLI,KAAM,SACNnB,SAAUP,EACVW,SAAUW","file":"highlight/elixir.js?v=b349577acd551df129fb","sourcesContent":["/*\nLanguage: Elixir\nAuthor: Josh Adams <josh@isotope11.com>\nDescription: language definition for Elixir source code files (.ex and .exs). Based on ruby language support.\nCategory: functional\nWebsite: https://elixir-lang.org\n*/\n\n/** @type LanguageFn */\nfunction elixir(hljs) {\n const ELIXIR_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_.]*(!|\\\\?)?';\n const ELIXIR_METHOD_RE = '[a-zA-Z_]\\\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\\\*\\\\*|[-/+%^&*~`|]|\\\\[\\\\]=?';\n const ELIXIR_KEYWORDS = {\n $pattern: ELIXIR_IDENT_RE,\n keyword: 'and false then defined module in return redo retry end for true self when ' +\n 'next until do begin unless nil break not case cond alias while ensure or ' +\n 'include use alias fn quote require import with|0'\n };\n const SUBST = {\n className: 'subst',\n begin: /#\\{/,\n end: /\\}/,\n keywords: ELIXIR_KEYWORDS\n };\n const NUMBER = {\n className: 'number',\n begin: '(\\\\b0o[0-7_]+)|(\\\\b0b[01_]+)|(\\\\b0x[0-9a-fA-F_]+)|(-?\\\\b[1-9][0-9_]*(\\\\.[0-9_]+([eE][-+]?[0-9]+)?)?)',\n relevance: 0\n };\n const SIGIL_DELIMITERS = '[/|([{<\"\\']';\n const LOWERCASE_SIGIL = {\n className: 'string',\n begin: '~[a-z]' + '(?=' + SIGIL_DELIMITERS + ')',\n contains: [\n {\n endsParent: true,\n contains: [\n {\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n variants: [\n {\n begin: /\"/,\n end: /\"/\n },\n {\n begin: /'/,\n end: /'/\n },\n {\n begin: /\\//,\n end: /\\//\n },\n {\n begin: /\\|/,\n end: /\\|/\n },\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n begin: /\\[/,\n end: /\\]/\n },\n {\n begin: /\\{/,\n end: /\\}/\n },\n {\n begin: /</,\n end: />/\n }\n ]\n }\n ]\n }\n ]\n };\n\n const UPCASE_SIGIL = {\n className: 'string',\n begin: '~[A-Z]' + '(?=' + SIGIL_DELIMITERS + ')',\n contains: [\n {\n begin: /\"/,\n end: /\"/\n },\n {\n begin: /'/,\n end: /'/\n },\n {\n begin: /\\//,\n end: /\\//\n },\n {\n begin: /\\|/,\n end: /\\|/\n },\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n begin: /\\[/,\n end: /\\]/\n },\n {\n begin: /\\{/,\n end: /\\}/\n },\n {\n begin: /</,\n end: />/\n }\n ]\n };\n\n const STRING = {\n className: 'string',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n variants: [\n {\n begin: /\"\"\"/,\n end: /\"\"\"/\n },\n {\n begin: /'''/,\n end: /'''/\n },\n {\n begin: /~S\"\"\"/,\n end: /\"\"\"/,\n contains: []\n },\n {\n begin: /~S\"/,\n end: /\"/,\n contains: []\n },\n {\n begin: /~S'''/,\n end: /'''/,\n contains: []\n },\n {\n begin: /~S'/,\n end: /'/,\n contains: []\n },\n {\n begin: /'/,\n end: /'/\n },\n {\n begin: /\"/,\n end: /\"/\n }\n ]\n };\n const FUNCTION = {\n className: 'function',\n beginKeywords: 'def defp defmacro',\n end: /\\B\\b/, // the mode is ended by the title\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: ELIXIR_IDENT_RE,\n endsParent: true\n })\n ]\n };\n const CLASS = hljs.inherit(FUNCTION, {\n className: 'class',\n beginKeywords: 'defimpl defmodule defprotocol defrecord',\n end: /\\bdo\\b|$|;/\n });\n const ELIXIR_DEFAULT_CONTAINS = [\n STRING,\n UPCASE_SIGIL,\n LOWERCASE_SIGIL,\n hljs.HASH_COMMENT_MODE,\n CLASS,\n FUNCTION,\n {\n begin: '::'\n },\n {\n className: 'symbol',\n begin: ':(?![\\\\s:])',\n contains: [\n STRING,\n {\n begin: ELIXIR_METHOD_RE\n }\n ],\n relevance: 0\n },\n {\n className: 'symbol',\n begin: ELIXIR_IDENT_RE + ':(?!:)',\n relevance: 0\n },\n NUMBER,\n {\n className: 'variable',\n begin: '(\\\\$\\\\W)|((\\\\$|@@?)(\\\\w+))'\n },\n {\n begin: '->'\n },\n { // regexp container\n begin: '(' + hljs.RE_STARTERS_RE + ')\\\\s*',\n contains: [\n hljs.HASH_COMMENT_MODE,\n {\n // to prevent false regex triggers for the division function:\n // /:\n begin: /\\/: (?=\\d+\\s*[,\\]])/,\n relevance: 0,\n contains: [NUMBER]\n },\n {\n className: 'regexp',\n illegal: '\\\\n',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n variants: [\n {\n begin: '/',\n end: '/[a-z]*'\n },\n {\n begin: '%r\\\\[',\n end: '\\\\][a-z]*'\n }\n ]\n }\n ],\n relevance: 0\n }\n ];\n SUBST.contains = ELIXIR_DEFAULT_CONTAINS;\n\n return {\n name: 'Elixir',\n keywords: ELIXIR_KEYWORDS,\n contains: ELIXIR_DEFAULT_CONTAINS\n };\n}\n\nmodule.exports = elixir;\n"],"sourceRoot":""}
|