]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/applescript.js
1 /*! `applescript` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Authors: Nathan Grigg <nathan@nathanamy.org>, Dr. Drang <drdrang@gmail.com>
9 Website: https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
13 /** @type LanguageFn */
14 function applescript(hljs
) {
15 const regex
= hljs
.regex
;
16 const STRING
= hljs
.inherit(
17 hljs
.QUOTE_STRING_MODE
, { illegal: null });
28 const COMMENT_MODE_1
= hljs
.COMMENT(/--/, /$/);
29 const COMMENT_MODE_2
= hljs
.COMMENT(
33 'self', // allow nesting
40 hljs
.HASH_COMMENT_MODE
43 const KEYWORD_PATTERNS
= [
49 /isn
't|(doesn't
|does not
) (equal
|come before
|come after
|contain
)/,
50 /(greater
|less
) than( or equal
)?/,
51 /(starts
?|ends
|begins
?) with/,
53 /comes (before
|after
)/,
60 const BUILT_IN_PATTERNS
= [
64 /list (disks
|folder
)/,
67 /(close
|open
for) access
/,
71 /get volume settings
/,
77 /(load
|run
|store
) script
/,
78 /scripting components
/,
79 /ASCII (character
|number
)/,
81 /choose (application
|color
|file
|file name
|folder
|from list
|remote application
|URL
)/,
82 /display (alert
|dialog
)/
87 aliases: [ 'osascript' ],
90 'about above after against and around as at back before beginning '
91 + 'behind below beneath beside between but by considering '
92 + 'contain contains continue copy div does eighth else end equal '
93 + 'equals error every exit fifth first for fourth from front '
94 + 'get given global if ignoring in into is it its last local me '
95 + 'middle mod my ninth not of on onto or over prop property put ref '
96 + 'reference repeat returning script second set seventh since '
97 + 'sixth some tell tenth that the|0 then third through thru '
98 + 'timeout times to transaction try until where while whose with '
101 'AppleScript false linefeed return pi quote result space tab true',
103 'alias application boolean class constant date file integer list '
104 + 'number real record string text '
105 + 'activate beep count delay launch log offset read round '
106 + 'run say summarize write '
107 + 'character characters contents day frontmost id item length '
108 + 'month name|0 paragraph paragraphs rest reverse running time version '
109 + 'weekday word words year'
115 className: 'built_in',
118 regex
.either(...BUILT_IN_PATTERNS
),
123 className: 'built_in',
124 begin: /^\s*return\b/
127 className: 'literal',
129 /\b(text item delimiters
|current application
|missing value
)\b/
132 className: 'keyword',
135 regex
.either(...KEYWORD_PATTERNS
),
143 hljs
.UNDERSCORE_TITLE_MODE
,
149 illegal: /\/\/|->|=>|\[\[/
157 export default hljsGrammar
;