text/js/elixir-DqR_ufeR.chunk.mjs

3 строки
2.8 KiB
JavaScript

/*! third party licenses: js/vendor.LICENSE.txt */
import{g as A}from"./emoji-picker-SoWZqoso.chunk.mjs";function N(n,r){for(var s=0;s<r.length;s++){const t=r[s];if(typeof t!="string"&&!Array.isArray(t)){for(const a in t)if(a!=="default"&&!(a in n)){const i=Object.getOwnPropertyDescriptor(t,a);i&&Object.defineProperty(n,a,i.get?i:{enumerable:!0,get:()=>t[a]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}function h(n){const r=n.regex,s="[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?",t="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",a={$pattern:s,keyword:["after","alias","and","case","catch","cond","defstruct","defguard","do","else","end","fn","for","if","import","in","not","or","quote","raise","receive","require","reraise","rescue","try","unless","unquote","unquote_splicing","use","when","with|0"],literal:["false","nil","true"]},i={className:"subst",begin:/#\{/,end:/\}/,keywords:a},u={className:"number",begin:"(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[0-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)",relevance:0},b={match:/\\[\s\S]/,scope:"char.escape",relevance:0},c="[/|([{<\"']",o=[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{begin:/\|/,end:/\|/},{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/,end:/\}/},{begin:/</,end:/>/}],d=e=>({scope:"char.escape",begin:r.concat(/\\/,e),relevance:0}),p={className:"string",begin:"~[a-z](?="+c+")",contains:o.map(e=>n.inherit(e,{contains:[d(e.end),b,i]}))},_={className:"string",begin:"~[A-Z](?="+c+")",contains:o.map(e=>n.inherit(e,{contains:[d(e.end)]}))},y={className:"regex",variants:[{begin:"~r(?="+c+")",contains:o.map(e=>n.inherit(e,{end:r.concat(e.end,/[uismxfU]{0,7}/),contains:[d(e.end),b,i]}))},{begin:"~R(?="+c+")",contains:o.map(e=>n.inherit(e,{end:r.concat(e.end,/[uismxfU]{0,7}/),contains:[d(e.end)]}))}]},g={className:"string",contains:[n.BACKSLASH_ESCAPE,i],variants:[{begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:/~S"""/,end:/"""/,contains:[]},{begin:/~S"/,end:/"/,contains:[]},{begin:/~S'''/,end:/'''/,contains:[]},{begin:/~S'/,end:/'/,contains:[]},{begin:/'/,end:/'/},{begin:/"/,end:/"/}]},l={className:"function",beginKeywords:"def defp defmacro defmacrop",end:/\B\b/,contains:[n.inherit(n.TITLE_MODE,{begin:s,endsParent:!0})]},v=n.inherit(l,{className:"class",beginKeywords:"defimpl defmodule defprotocol defrecord",end:/\bdo\b|$|;/}),f=[g,y,_,p,n.HASH_COMMENT_MODE,v,l,{begin:"::"},{className:"symbol",begin:":(?![\\s:])",contains:[g,{begin:t}],relevance:0},{className:"symbol",begin:s+":(?!:)",relevance:0},{className:"title.class",begin:/(\b[A-Z][a-zA-Z0-9_]+)/,relevance:0},u,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))"}];return i.contains=f,{name:"Elixir",aliases:["ex","exs"],keywords:a,contains:f}}var m=h;const S=A(m),x=N({__proto__:null,default:S},[m]);export{m as a,x as e};