mirror of
https://github.com/owncast/owncast.git
synced 2025-01-04 15:47:41 +03:00
1 line
No EOL
3.2 KiB
JavaScript
Vendored
1 line
No EOL
3.2 KiB
JavaScript
Vendored
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7365],{57365:function(e,t,n){function wordObj(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}n.r(t),n.d(t,{r:function(){return p}});var r,a=["NULL","NA","Inf","NaN","NA_integer_","NA_real_","NA_complex_","NA_character_","TRUE","FALSE"],i=["list","quote","bquote","eval","return","call","parse","deparse"],o=["if","else","repeat","while","function","for","in","next","break"],u=wordObj(a),c=wordObj(i),l=wordObj(o),s=wordObj(["if","else","repeat","while","function","for"]),f=/[+\-*\/^<>=!&|~$:]/;function tokenBase(e,t){r=null;var n=e.next();if("#"==n)return e.skipToEnd(),"comment";if("0"==n&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if("."==n&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(n))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if("'"==n||'"'==n)return t.tokenize=tokenString(n),"string";if("`"==n)return e.match(/[^`]+`/),"string.special";if("."==n&&e.match(/.(?:[.]|\d+)/))return"keyword";else if(/[a-zA-Z\.]/.test(n)){e.eatWhile(/[\w\.]/);var a=e.current();return u.propertyIsEnumerable(a)?"atom":l.propertyIsEnumerable(a)?(s.propertyIsEnumerable(a)&&!e.match(/\s*if(\s+|$)/,!1)&&(r="block"),"keyword"):c.propertyIsEnumerable(a)?"builtin":"variable"}else if("%"==n)return e.skipTo("%")&&e.next(),"variableName.special";else if("<"==n&&e.eat("-")||"<"==n&&e.match("<-")||"-"==n&&e.match(/>>?/))return"operator";else if("="==n&&t.ctx.argList)return"operator";else if(f.test(n))return"$"==n||e.eatWhile(f),"operator";else if(!/[\(\){}\[\];]/.test(n))return null;else return(r=n,";"==n)?"punctuation":null}function tokenString(e){return function(t,n){if(t.eat("\\")){var r,a=t.next();return"x"==a?t.match(/^[a-f0-9]{2}/i):("u"==a||"U"==a)&&t.eat("{")&&t.skipTo("}")?t.next():"u"==a?t.match(/^[a-f0-9]{4}/i):"U"==a?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(a)&&t.match(/^[0-7]{1,2}/),"string.special"}for(;null!=(r=t.next());){if(r==e){n.tokenize=tokenBase;break}if("\\"==r){t.backUp(1);break}}return"string"}}function push(e,t,n){e.ctx={type:t,indent:e.indent,flags:0,column:n.column(),prev:e.ctx}}function setFlag(e,t){var n=e.ctx;e.ctx={type:n.type,indent:n.indent,flags:n.flags|t,column:n.column,prev:n.prev}}function pop(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}let p={name:"r",startState:function(e){return{tokenize:tokenBase,ctx:{type:"top",indent:-e,flags:2},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&((3&t.ctx.flags)==0&&(t.ctx.flags|=2),4&t.ctx.flags&&pop(t),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"!=n&&(2&t.ctx.flags)==0&&setFlag(t,1),(";"==r||"{"==r||"}"==r)&&"block"==t.ctx.type&&pop(t),"{"==r?push(t,"}",e):"("==r?(push(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==r?push(t,"]",e):"block"==r?push(t,"block",e):r==t.ctx.type?pop(t):"block"==t.ctx.type&&"comment"!=n&&setFlag(t,4),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(e,t,n){if(e.tokenize!=tokenBase)return 0;var r=t&&t.charAt(0),a=e.ctx,i=r==a.type;return(4&a.flags&&(a=a.prev),"block"==a.type)?a.indent+("{"==r?0:n.unit):1&a.flags?a.column+(i?0:1):a.indent+(i?0:n.unit)},languageData:{wordChars:".",commentTokens:{line:"#"},autocomplete:a.concat(i,o)}}}}]); |