site/node_modules/shiki/dist/langs/hack.mjs

18 lines
85 KiB
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
import html from './html.mjs';
import sql from './sql.mjs';
import './javascript.mjs';
import './css.mjs';
const lang = Object.freeze({ "displayName": "Hack", "fileTypes": ["hh", "php", "hack"], "foldingStartMarker": "(/\\*|\\{\\s*$|<<<HTML)", "foldingStopMarker": "(\\*/|^\\s*\\}|^HTML;)", "name": "hack", "patterns": [{ "include": "text.html.basic" }, { "include": "#language" }], "repository": { "attributes": { "patterns": [{ "begin": "(<<)(?!<)", "beginCaptures": { "1": { "name": "punctuation.definition.attributes.php" } }, "end": "(>>)", "endCaptures": { "1": { "name": "punctuation.definition.attributes.php" } }, "name": "meta.attributes.php", "patterns": [{ "include": "#comments" }, { "match": "([A-Za-z_][A-Za-z0-9_]*)", "name": "entity.other.attribute-name.php" }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.definition.parameters.begin.php" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.php" } }, "patterns": [{ "include": "#language" }] }] }] }, "class-builtin": { "patterns": [{ "captures": { "1": { "name": "punctuation.separator.inheritance.php" } }, "match": "(?i)(\\\\)?\\b(st(dClass|reamWrapper)|R(RD(Graph|Creator|Updater)|untimeException|e(sourceBundle|cursive(RegexIterator|Ca(chingIterator|llbackFilterIterator)|TreeIterator|Iterator(Iterator)?|DirectoryIterator|FilterIterator|ArrayIterator)|flect(ion(Method|Class|ZendExtension|Object|P(arameter|roperty)|Extension|Function(Abstract)?)?|or)|gexIterator)|angeException)|G(ender\\Gender|lobIterator|magick(Draw|Pixel)?)|X(sltProcessor|ML(Reader|Writer)|SLTProcessor)|M(ysqlndUh(Connection|PreparedStatement)|ongo(Re(sultException|gex)|Grid(fsFile|FS(Cursor|File)?)|BinData|C(o(de|llection)|ursor(Exception)?|lient)|Timestamp|I(nt(32|64)|d)|D(B(Ref)?|ate)|Pool|Log)?|u(tex|ltipleIterator)|e(ssageFormatter|mcache(d)?))|Bad(MethodCallException|FunctionCallException)|tidy(Node)?|S(tackable|impleXML(Iterator|Element)|oap(Server|Header|Client|Param|Var|Fault)|NMP|CA(_(SoapProxy|LocalProxy))?|p(hinxClient|oofchecker|l(M(inHeap|axHeap)|S(tack|ubject)|Heap|T(ype|empFileObject)|Ob(server|jectStorage)|DoublyLinkedList|PriorityQueue|Enum|Queue|Fi(le(Info|Object)|xedArray)))|e(ssionHandler(Interface)?|ekableIterator|rializable)|DO_(Model_(ReflectionDataObject|Type|Property)|Sequence|D(ata(Object|Factory)|AS_(Relational|XML(_Document)?|Setting|ChangeSummary|Data(Object|Factory)))|Exception|List)|wish(Result(s)?|Search)?|VM(Model)?|QLite(Result|3(Result|Stmt)?|Database|Unbuffered)|AM(Message|Connection))|H(ttp(Re(sponse|quest(Pool)?)|Message|InflateStream|DeflateStream|QueryString)|aru(Image|Outline|D(oc|estination)|Page|Encoder|Font|Annotation))|Yaf_(R(oute(_(Re(write|gex)|Map|S(tatic|imple|upervar)|Interface)|r)|e(sponse_Abstract|quest_(Simple|Http|Abstract)|gistry))|Session|Con(troller_Abstract|fig_(Simple|Ini|Abstract))|Dispatcher|Plugin_Abstract|Exception|View_(Simple|Interface)|Loader|A(ction_Abstract|pplication))|N(o(RewindIterator|rmalizer)|umberFormatter)|C(o(nd|untable|llator)|a(chingIterator|llbackFilterIterator))|T(hread|okyoTyrant(Table|Iterator|Query)?|ra(nsliterator|versable))|I(n(tlDateFormatter|validArgumentException|finiteIterator)|terator(Iterator|Aggregate)?|magick(Draw|Pixel(Iterator)?)?)|php_user_filter|ZipArchive|O(CI-(Collection|Lob)|ut(erIterator|Of(RangeException|BoundsException))|verflowException)|D(irectory(Iterator)?|omainException|OM(XPath|N(ode(list)?|amedNodeMap)|C(haracterData|omment|dataSection)|Text|Implementation|Document(Fragment)?|ProcessingInstruction|E(ntityReference|lement)|Attr)|ate(Time(Zone)?|Interval|Period))|Un(derflowException|expectedValueException)|JsonSerializable|finfo|P(har(Data|FileInfo)?|DO(Statement)?|arentIterator)|E(v(S(tat|ignal)|Ch(ild|eck)|Timer|I(o|dle)|P(eriodic|repare)|Embed|Fork|Watcher|Loop)?|rrorException|xception|mptyIterator)|V(8Js(Exception)?|arnish(Stat|Log|Admin))|KTaglib_(MPEG_(File|AudioProperties)|Tag|ID3v2_(Tag|Frame|AttachedPictureFrame))|QuickHash(StringIntHash|Int(S(tringHash|et)|Hash))|Fil(terIterator|esystemIterator)|mysqli(_(stmt|driver|warning|result))?|W(orker|eak(Map|ref))|L(imitIterator|o(cale|gicException)|ua(Closure)?|engthException|apack)|
Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'"`, "match": `'(?=((\\\\')|[^'"])*("|$))`, "name": "string.quoted.single.unclosed.sql" }, { "comment": `Unclosed strings must be captured to avoid them eating the remainder of the PHP script
Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'"`, "match": '`(?=((\\\\`)|[^`"])*("|$))', "name": "string.quoted.other.backtick.unclosed.sql" }, { "begin": "'", "end": "'", "name": "string.quoted.single.sql", "patterns": [{ "include": "#interpolation" }] }, { "begin": "`", "end": "`", "name": "string.quoted.other.backtick.sql", "patterns": [{ "include": "#interpolation" }] }, { "include": "#interpolation" }, { "include": "source.sql" }] }, "sql-string-single-quoted": { "begin": "'\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\\b)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.php" } }, "contentName": "source.sql.embedded.php", "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.php" } }, "name": "string.quoted.single.sql.php", "patterns": [{ "comment": "Open parens cause the next escaped character to not be captured as an\nescape character. Example: $x = 'SELECT (')';", "match": "\\(", "name": "punctuation.definition.parameters.begin.bracket.round.php" }, { "match": "#(\\\\'|[^'])*(?='|$\\n?)", "name": "comment.line.number-sign.sql" }, { "match": "--(\\\\'|[^'])*(?='|$\\n?)", "name": "comment.line.double-dash.sql" }, { "match": "\\\\[\\\\'`\"]", "name": "constant.character.escape.php" }, { "comment": `Unclosed strings must be captured to avoid them eating the remainder of the PHP script
Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'"`, "match": "`(?=((\\\\`)|[^`'])*('|$))", "name": "string.quoted.other.backtick.unclosed.sql" }, { "comment": `Unclosed strings must be captured to avoid them eating the remainder of the PHP script
Sample case: $sql = "SELECT * FROM bar WHERE foo = '" . $variable . "'"`, "match": `"(?=((\\\\")|[^"'])*('|$))`, "name": "string.quoted.double.unclosed.sql" }, { "include": "source.sql" }] }, "string-double-quoted": { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.php" } }, "comment": "This contentName is just to allow the usage of \u201Cselect scope\u201D to select the string contents first, then the string with quotes", "contentName": "meta.string-contents.quoted.double.php", "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.php" } }, "name": "string.quoted.double.php", "patterns": [{ "include": "#interpolation" }] }, "string-single-quoted": { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.php" } }, "contentName": "meta.string-contents.quoted.single.php", "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.php" } }, "name": "string.quoted.single.php", "patterns": [{ "match": "\\\\[\\\\']", "name": "constant.character.escape.php" }] }, "strings": { "patterns": [{ "include": "#regex-double-quoted" }, { "include": "#sql-string-double-quoted" }, { "include": "#string-double-quoted" }, { "include": "#regex-single-quoted" }, { "include": "#sql-string-single-quoted" }, { "include": "#string-single-quoted" }] }, "support": { "patterns": [{ "match": "(?i)\\bapc_(s(tore|ma_info)|c(ompile_file|lear_cache|a(s|che_info))|inc|de(c|fine_constants|lete(_file)?)|exists|fetch|load_constants|add|bin_(dump(file)?|load(file)?))\\b", "name": "support.function.apc.php" }, { "match": "(?i)\\b(s(huffle|izeof|ort)|n(ext|at(sort|casesort))|c(o(unt|mpact)|urrent)|in_array|u(sort|ksort|asort)|p(os|rev)|e(nd|ach|xtract)|k(sort|ey|rsort)|list|a(sort|r(sort|ray(_(s(hift|um|plice|earch|lice)|c(h(unk|ange_key_case)|o(unt_values|mbine))|intersect(_(u(key|assoc)|key|assoc))?|diff(_(u(key|assoc)|key|assoc))?|u(n(shift|ique)|intersect(_(uassoc|assoc))?|diff(_(uassoc|assoc))?)|p(op|ush|ad|roduct)|values|key(s|_exists)|f(il(ter|l(_keys)?)|lip)|walk(_recursive)?|r(e(duce|place(_recursive)?|verse)|and)|m(ultisort|erge(_recursive)?|ap)))?))|r(sort|eset|ange))\\b", "name": "support.function.array.php" }, { "match": "(?i)\\b(s(how_source|ys_getloadavg|leep)|highlight_(string|file)|con(stant|nection_(status|timeout|aborted))|time_(sleep_until|nanosleep)|ignore_user_abort|d(ie|efine(d)?)|u(sleep|n(iqid|pack))|__halt_compiler|p(hp_(strip_whitespace|check_syntax)|ack)|e(val|xit)|get_browser)\\b", "name": "support.function.basic_functions.php" }, { "match": "(?i)\\bbc(s(cale|ub|qrt)|comp|div|pow(mod)?|add|m(od|ul))\\b", "name": "support.function.bcmath.php" }, { "match": "(?i)\\bbz(c(ompress|lose)|open|decompress|err(str|no|or)|flush|write|read)\\b", "name": "support.function.bz2.php" }, { "match": "(?i)\\b(GregorianToJD|cal_(to_jd|info|days_in_month|from_jd)|unixtojd|jdto(unix|jewish)|easter_da(ys|te)|J(ulianToJD|ewishToJD|D(MonthName|To(Gregorian|Julian|French)|DayOfWeek))|FrenchToJD)\\b", "name": "support.function.calendar.php" }, { "match": "(?i)\\b(c(lass_(exists|alias)|all_user_method(_array)?)|trait_exists|i(s_(subclass_of|a)|nterface_exists)|__autoload|property_exists|get_(c(lass(_(vars|methods))?|alled_class)|object_vars|declared_(classes|traits|interfaces)|parent_class)|method_exists)\\b", "name": "support.function.classobj.php" }, { "match": "(?i)\\b(com_(set|create_guid|i(senum|nvoke)|pr(int_typeinfo|op(set|put|get))|event_sink|load(_typelib)?|addref|release|get(_active_object)?|message_pump)|variant_(s(ub|et(_type)?)|n(ot|eg)|c(a(st|t)|mp)|i(nt|div|mp)|or|d(iv|ate_(to_timestamp|from_timestamp))|pow|eqv|fix|a(nd|dd|bs)|round|get_type|xor|m(od|ul)))\\b", "name": "support.function.com.php" }, { "match": "(?i)\\bctype_(space|cntrl|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit)\\b", "name": "support.function.ctype.php" }, { "match": "(?i)\\bcurl_(setopt(_array)?|c(opy_handle|lose)|init|e(rr(no|or)|xec)|version|getinfo|multi_(select|close|in(it|fo_read)|exec|add_handle|remove_handle|getcontent))\\b", "name": "support.fun
var hack = [
...html,
...sql,
lang
];
export { hack as default };