Файл: error-kitty/node_modules/highlight.js/lib/languages/bash.js
Строк: 48
<?php
module.exports = function(hljs) {
var VAR = {
className: 'variable',
variants: [
{begin: /$[wd#@][wd_]*/},
{begin: /${(.*?)}/}
]
};
var QUOTE_STRING = {
className: 'string',
begin: /"/, end: /"/,
contains: [
hljs.BACKSLASH_ESCAPE,
VAR,
{
className: 'variable',
begin: /$(/, end: /)/,
contains: [hljs.BACKSLASH_ESCAPE]
}
]
};
var APOS_STRING = {
className: 'string',
begin: /'/, end: /'/
};
return {
aliases: ['sh', 'zsh'],
lexemes: /-?[a-z.]+/,
keywords: {
keyword:
'if then else elif fi for break continue while in do done exit return set '+
'declare case esac export exec',
literal:
'true false',
built_in:
'printf echo read cd pwd pushd popd dirs let eval unset typeset readonly '+
'getopts source shopt caller type hash bind help sudo',
operator:
'-ne -eq -lt -gt -f -d -e -s -l -a' // relevance booster
},
contains: [
{
className: 'shebang',
begin: /^#![^n]+shs*$/,
relevance: 10
},
{
className: 'function',
begin: /w[wd_]*s*(s*)s*{/,
returnBegin: true,
contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /w[wd_]*/})],
relevance: 0
},
hljs.HASH_COMMENT_MODE,
hljs.NUMBER_MODE,
QUOTE_STRING,
APOS_STRING,
VAR
]
};
};
?>