]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/aspectj.js
1 /*! `aspectj` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Author: Hakan Ozler <ozler.hakan@gmail.com>
9 Website: https://www.eclipse.org/aspectj/
10 Description: Syntax Highlighting for the AspectJ Language which is a general-purpose aspect-oriented extension to the Java programming language.
15 /** @type LanguageFn */
16 function aspectj(hljs
) {
17 const regex
= hljs
.regex
;
76 "staticinitialization",
84 "thisJoinPointStaticPart",
85 "thisEnclosingJoinPointStaticPart",
113 // eat up @'s in emails to prevent them to be recognized as doctags
124 hljs
.C_LINE_COMMENT_MODE
,
125 hljs
.C_BLOCK_COMMENT_MODE
,
126 hljs
.APOS_STRING_MODE
,
127 hljs
.QUOTE_STRING_MODE
,
130 beginKeywords: 'aspect',
133 illegal: /[:;"\[\]]/,
135 { beginKeywords: 'extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton' },
136 hljs
.UNDERSCORE_TITLE_MODE
,
140 keywords: KEYWORDS
.concat(SHORTKEYS
),
147 beginKeywords: 'class interface',
151 keywords: 'class interface',
154 { beginKeywords: 'extends implements' },
155 hljs
.UNDERSCORE_TITLE_MODE
159 // AspectJ Constructs
160 beginKeywords: 'pointcut after before around throwing returning',
166 begin: regex
.concat(hljs
.UNDERSCORE_IDENT_RE
, /\s*\(/),
168 contains: [ hljs
.UNDERSCORE_TITLE_MODE
]
182 begin: regex
.concat(hljs
.UNDERSCORE_IDENT_RE
, /\s*\(/),
183 keywords: KEYWORDS
.concat(SHORTKEYS
),
186 hljs
.QUOTE_STRING_MODE
190 // this prevents 'new Name(...), or throw ...' from being recognized as a function definition
191 beginKeywords: 'new throw',
195 // the function class is a bit different for AspectJ compared to the Java language
196 className: 'function',
197 begin: /\w
+ +\w
+(\.\w
+)?\s
*\([^\)]*\)\s
*((throws)[\w
\s
,]+)?[\{;]/,
204 begin: regex
.concat(hljs
.UNDERSCORE_IDENT_RE
, /\s*\(/),
207 contains: [ hljs
.UNDERSCORE_TITLE_MODE
]
216 hljs
.APOS_STRING_MODE
,
217 hljs
.QUOTE_STRING_MODE
,
219 hljs
.C_BLOCK_COMMENT_MODE
222 hljs
.C_LINE_COMMENT_MODE
,
223 hljs
.C_BLOCK_COMMENT_MODE
228 // annotation is also used in this language
240 hljs
.registerLanguage('aspectj', hljsGrammar
);