XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESystem

【Rust】XFE系统,基于Rust和汇编

公开
关注 0 Fork 0 Star 0
UTF-8
/*! `powershell` grammar compiled for Highlight.js 11.11.1 */
(function () {
    var hljsGrammar = (function () {
        'use strict';

        /*
        Language: PowerShell
        Author: David Mohl <david@dmohl.com>
        Contributor: Nicholas Blumhardt <nblumhardt@nblumhardt.com>, Jason Moseley <jmoseley@jmoseley.com>
        Website: https://docs.microsoft.com/en-us/powershell/
        Category: common
        */

        /** @type LanguageFn */
        function powershell(hljs) {
            const VARIABLE = {
                className: 'term-variable',
                variants: [
                    { begin: /\$[\w\d][\w\d_:]*/ }
                ]
            };
            const QUOTE_STRING = {
                className: 'term-string',
                begin: /"/, end: /"/,
                contains: [
                    hljs.BACKSLASH_ESCAPE,
                    VARIABLE
                ]
            };
            const APOS_STRING = {
                className: 'term-string',
                begin: /'/, end: /'/
            };

            return {
                name: 'PowerShell',
                aliases: ['ps', 'ps1'],
                case_insensitive: true,
                contains: [
                    hljs.COMMENT(/#/, /$/),
                    QUOTE_STRING,
                    APOS_STRING,
                     // Command at start of line
                    {
                        className: 'term-command',
                        begin: /^\s*[\w\d_-]+/,
                    },
                     // Options starting with -
                    {
                        className: 'term-option',
                        begin: /\s-[\w\d_-]+/,
                    },
                    VARIABLE,
                    {
                        className: 'term-number',
                        begin: /\b\d+\b/
                    }
                ]
            };
        }

        return powershell;

    })();

    hljs.registerLanguage('powershell', hljsGrammar);
})();