aboutsummaryrefslogtreecommitdiff
path: root/node_modules/highlight.js/lib/languages/bash.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-05-24 15:10:37 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-05-24 15:11:17 +0200
commit7a3df06eb573d36142bd1a8e03c5ce8752d300b3 (patch)
tree70bfaea8884c374876f607774850a3a51c0cb381 /node_modules/highlight.js/lib/languages/bash.js
parentaca1143cb9eed16cf37f04e475e4257418dd18ac (diff)
downloadwallet-core-7a3df06eb573d36142bd1a8e03c5ce8752d300b3.tar.xz
fix build issues and add typedoc
Diffstat (limited to 'node_modules/highlight.js/lib/languages/bash.js')
-rw-r--r--node_modules/highlight.js/lib/languages/bash.js74
1 files changed, 74 insertions, 0 deletions
diff --git a/node_modules/highlight.js/lib/languages/bash.js b/node_modules/highlight.js/lib/languages/bash.js
new file mode 100644
index 000000000..a8bb5d2fb
--- /dev/null
+++ b/node_modules/highlight.js/lib/languages/bash.js
@@ -0,0 +1,74 @@
+module.exports = function(hljs) {
+ var VAR = {
+ className: 'variable',
+ variants: [
+ {begin: /\$[\w\d#@][\w\d_]*/},
+ {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 while in do done case esac function',
+ literal:
+ 'true false',
+ built_in:
+ // Shell built-ins
+ // http://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
+ 'break cd continue eval exec exit export getopts hash pwd readonly return shift test times ' +
+ 'trap umask unset ' +
+ // Bash built-ins
+ 'alias bind builtin caller command declare echo enable help let local logout mapfile printf ' +
+ 'read readarray source type typeset ulimit unalias ' +
+ // Shell modifiers
+ 'set shopt ' +
+ // Zsh built-ins
+ 'autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles ' +
+ 'compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate ' +
+ 'fc fg float functions getcap getln history integer jobs kill limit log noglob popd print ' +
+ 'pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit ' +
+ 'unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof ' +
+ 'zpty zregexparse zsocket zstyle ztcp',
+ _:
+ '-ne -eq -lt -gt -f -d -e -s -l -a' // relevance booster
+ },
+ contains: [
+ {
+ className: 'meta',
+ begin: /^#![^\n]+sh\s*$/,
+ relevance: 10
+ },
+ {
+ className: 'function',
+ begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
+ returnBegin: true,
+ contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\w[\w\d_]*/})],
+ relevance: 0
+ },
+ hljs.HASH_COMMENT_MODE,
+ QUOTE_STRING,
+ APOS_STRING,
+ VAR
+ ]
+ };
+}; \ No newline at end of file