Files
owncast/static/web/_next/static/chunks/1873.cf0d6495f7f707ba.js
2023-10-06 07:22:08 +00:00

1 line
2.3 KiB
JavaScript
Vendored

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1873],{11873:function(e,t,n){n.r(t),n.d(t,{smalltalk:function(){return r}});var a=/[+\-\/\\*~<>=@%|&?!.,:;^]/,i=/true|false|nil|self|super|thisContext/,Context=function(e,t){this.next=e,this.parent=t},Token=function(e,t,n){this.name=e,this.context=t,this.eos=n},State=function(){this.context=new Context(next,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};State.prototype.userIndent=function(e,t){this.userIndentationDelta=e>0?e/t-this.indentation:0};var next=function(e,t,n){var r=new Token(null,t,!1),o=e.next();return'"'===o?r=nextComment(e,new Context(nextComment,t)):"'"===o?r=nextString(e,new Context(nextString,t)):"#"===o?"'"===e.peek()?(e.next(),r=nextSymbol(e,new Context(nextSymbol,t))):e.eatWhile(/[^\s.{}\[\]()]/)?r.name="string.special":r.name="meta":"$"===o?("<"===e.next()&&(e.eatWhile(/[^\s>]/),e.next()),r.name="string.special"):"|"===o&&n.expectVariable?r.context=new Context(nextTemporaries,t):/[\[\]{}()]/.test(o)?(r.name="bracket",r.eos=/[\[{(]/.test(o),"["===o?n.indentation++:"]"===o&&(n.indentation=Math.max(0,n.indentation-1))):a.test(o)?(e.eatWhile(a),r.name="operator",r.eos=";"!==o):/\d/.test(o)?(e.eatWhile(/[\w\d]/),r.name="number"):/[\w_]/.test(o)?(e.eatWhile(/[\w\d_]/),r.name=n.expectVariable?i.test(e.current())?"keyword":"variable":null):r.eos=n.expectVariable,r},nextComment=function(e,t){return e.eatWhile(/[^"]/),new Token("comment",e.eat('"')?t.parent:t,!0)},nextString=function(e,t){return e.eatWhile(/[^']/),new Token("string",e.eat("'")?t.parent:t,!1)},nextSymbol=function(e,t){return e.eatWhile(/[^']/),new Token("string.special",e.eat("'")?t.parent:t,!1)},nextTemporaries=function(e,t){var n=new Token(null,t,!1);return"|"===e.next()?(n.context=t.parent,n.eos=!0):(e.eatWhile(/[^|]/),n.name="variable"),n};let r={name:"smalltalk",startState:function(){return new State},token:function(e,t){if(t.userIndent(e.indentation(),e.indentUnit),e.eatSpace())return null;var n=t.context.next(e,t.context,t);return t.context=n.context,t.expectVariable=n.eos,n.name},blankLine:function(e,t){e.userIndent(0,t)},indent:function(e,t,n){var a=e.context.next===next&&t&&"]"===t.charAt(0)?-1:e.userIndentationDelta;return(e.indentation+a)*n.unit},languageData:{indentOnInput:/^\s*\]$/}}}}]);