aspectj function
Highlight.js language definition for aspectj.
Implementation
Mode aspectj(Highlight hljs) {
final Mode mode0 = Mode();
final Mode mode1 = Mode();
final Mode mode2 = Mode();
final Mode mode3 = Mode();
final Mode mode4 = Mode();
final Mode mode5 = Mode();
final Mode mode6 = Mode();
final Mode mode7 = Mode();
final Mode mode8 = Mode();
final Mode mode9 = Mode();
final Mode mode10 = Mode();
mode0.scope = r'comment';
mode0.begin = r'//';
mode0.end = r'$';
mode0.contains = [mode1, mode2];
mode1.scope = r'doctag';
mode1.begin = r'[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)';
mode1.end = r'(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):';
mode1.excludeBegin = true;
mode1.relevance = 0;
mode2.begin =
r"[ ]+((?:I|a|is|so|us|to|at|if|in|it|on|[A-Za-z]+['](d|ve|re|ll|t|s|n)|[A-Za-z]+[-][a-z]+|[A-Za-z][a-z]{2,})[.]?[:]?([.][ ]|[ ])){3}";
mode3.scope = r'comment';
mode3.begin = r'/\*';
mode3.end = r'\*/';
mode3.contains = [mode4, mode5];
mode4.scope = r'doctag';
mode4.begin = r'[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)';
mode4.end = r'(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):';
mode4.excludeBegin = true;
mode4.relevance = 0;
mode5.begin =
r"[ ]+((?:I|a|is|so|us|to|at|if|in|it|on|[A-Za-z]+['](d|ve|re|ll|t|s|n)|[A-Za-z]+[-][a-z]+|[A-Za-z][a-z]{2,})[.]?[:]?([.][ ]|[ ])){3}";
mode6.scope = r'string';
mode6.begin = r"'";
mode6.end = r"'";
mode6.illegal = r'\n';
mode6.contains = [mode7];
mode7.begin = r'\\[\s\S]';
mode7.relevance = 0;
mode8.scope = r'string';
mode8.begin = r'"';
mode8.end = r'"';
mode8.illegal = r'\n';
mode8.contains = [mode7];
mode9.scope = r'title';
mode9.begin = r'[a-zA-Z_]\w*';
mode9.relevance = 0;
mode10.scope = r'number';
mode10.begin =
r'(-?)(\b0[xX][a-fA-F0-9]+|(\b\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)';
mode10.relevance = 0;
return Mode(
name: r'AspectJ',
keywords: [
r'false',
r'synchronized',
r'int',
r'abstract',
r'float',
r'private',
r'char',
r'boolean',
r'static',
r'null',
r'if',
r'const',
r'for',
r'true',
r'while',
r'long',
r'throw',
r'strictfp',
r'finally',
r'protected',
r'import',
r'native',
r'final',
r'return',
r'void',
r'enum',
r'else',
r'extends',
r'implements',
r'break',
r'transient',
r'new',
r'catch',
r'instanceof',
r'byte',
r'super',
r'volatile',
r'case',
r'assert',
r'short',
r'package',
r'default',
r'double',
r'public',
r'try',
r'this',
r'switch',
r'continue',
r'throws',
r'privileged',
r'aspectOf',
r'adviceexecution',
r'proceed',
r'cflowbelow',
r'cflow',
r'initialization',
r'preinitialization',
r'staticinitialization',
r'withincode',
r'target',
r'within',
r'execution',
r'getWithinTypeName',
r'handler',
r'thisJoinPoint',
r'thisJoinPointStaticPart',
r'thisEnclosingJoinPointStaticPart',
r'declare',
r'parents',
r'warning',
r'error',
r'soft',
r'precedence',
r'thisAspectInstance',
],
illegal: r'<\/|#',
contains: [
Mode(
scope: r'comment',
begin: r'\/\*\*',
end: r'\*\/',
contains: [
Mode(begin: r'\w+@', relevance: 0),
Mode(scope: r'doctag', begin: r'@[A-Za-z]+'),
Mode(
scope: r'doctag',
begin: r'[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)',
end: r'(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):',
excludeBegin: true,
relevance: 0,
),
Mode(
begin:
r"[ ]+((?:I|a|is|so|us|to|at|if|in|it|on|[A-Za-z]+['](d|ve|re|ll|t|s|n)|[A-Za-z]+[-][a-z]+|[A-Za-z][a-z]{2,})[.]?[:]?([.][ ]|[ ])){3}",
),
],
relevance: 0,
),
mode0,
mode3,
mode6,
mode8,
Mode(
scope: r'class',
beginKeywords: r'aspect',
end: r'[{;=]',
excludeEnd: true,
illegal: r'[:;"\[\]]',
contains: [
Mode(
beginKeywords:
r'extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton',
),
mode9,
Mode(
begin: r'\([^\)]*',
end: r'[)]+',
keywords: [
r'false',
r'synchronized',
r'int',
r'abstract',
r'float',
r'private',
r'char',
r'boolean',
r'static',
r'null',
r'if',
r'const',
r'for',
r'true',
r'while',
r'long',
r'throw',
r'strictfp',
r'finally',
r'protected',
r'import',
r'native',
r'final',
r'return',
r'void',
r'enum',
r'else',
r'extends',
r'implements',
r'break',
r'transient',
r'new',
r'catch',
r'instanceof',
r'byte',
r'super',
r'volatile',
r'case',
r'assert',
r'short',
r'package',
r'default',
r'double',
r'public',
r'try',
r'this',
r'switch',
r'continue',
r'throws',
r'privileged',
r'aspectOf',
r'adviceexecution',
r'proceed',
r'cflowbelow',
r'cflow',
r'initialization',
r'preinitialization',
r'staticinitialization',
r'withincode',
r'target',
r'within',
r'execution',
r'getWithinTypeName',
r'handler',
r'thisJoinPoint',
r'thisJoinPointStaticPart',
r'thisEnclosingJoinPointStaticPart',
r'declare',
r'parents',
r'warning',
r'error',
r'soft',
r'precedence',
r'thisAspectInstance',
r'get',
r'set',
r'args',
r'call',
],
excludeEnd: false,
),
],
),
Mode(
scope: r'class',
beginKeywords: r'class interface',
end: r'[{;=]',
excludeEnd: true,
relevance: 0,
keywords: r'class interface',
illegal: r'[:"\[\]]',
contains: [
Mode(beginKeywords: r'extends implements'),
mode9,
],
),
Mode(
beginKeywords: r'pointcut after before around throwing returning',
end: r'[)]',
excludeEnd: false,
illegal: r'["\[\]]',
contains: [
Mode(
begin: r'[a-zA-Z_]\w*\s*\(',
returnBegin: true,
contains: [mode9],
),
],
),
Mode(
begin: r'[:]',
returnBegin: true,
end: r'[{;]',
relevance: 0,
excludeEnd: false,
keywords: [
r'false',
r'synchronized',
r'int',
r'abstract',
r'float',
r'private',
r'char',
r'boolean',
r'static',
r'null',
r'if',
r'const',
r'for',
r'true',
r'while',
r'long',
r'throw',
r'strictfp',
r'finally',
r'protected',
r'import',
r'native',
r'final',
r'return',
r'void',
r'enum',
r'else',
r'extends',
r'implements',
r'break',
r'transient',
r'new',
r'catch',
r'instanceof',
r'byte',
r'super',
r'volatile',
r'case',
r'assert',
r'short',
r'package',
r'default',
r'double',
r'public',
r'try',
r'this',
r'switch',
r'continue',
r'throws',
r'privileged',
r'aspectOf',
r'adviceexecution',
r'proceed',
r'cflowbelow',
r'cflow',
r'initialization',
r'preinitialization',
r'staticinitialization',
r'withincode',
r'target',
r'within',
r'execution',
r'getWithinTypeName',
r'handler',
r'thisJoinPoint',
r'thisJoinPointStaticPart',
r'thisEnclosingJoinPointStaticPart',
r'declare',
r'parents',
r'warning',
r'error',
r'soft',
r'precedence',
r'thisAspectInstance',
],
illegal: r'["\[\]]',
contains: [
Mode(
begin: r'[a-zA-Z_]\w*\s*\(',
keywords: [
r'false',
r'synchronized',
r'int',
r'abstract',
r'float',
r'private',
r'char',
r'boolean',
r'static',
r'null',
r'if',
r'const',
r'for',
r'true',
r'while',
r'long',
r'throw',
r'strictfp',
r'finally',
r'protected',
r'import',
r'native',
r'final',
r'return',
r'void',
r'enum',
r'else',
r'extends',
r'implements',
r'break',
r'transient',
r'new',
r'catch',
r'instanceof',
r'byte',
r'super',
r'volatile',
r'case',
r'assert',
r'short',
r'package',
r'default',
r'double',
r'public',
r'try',
r'this',
r'switch',
r'continue',
r'throws',
r'privileged',
r'aspectOf',
r'adviceexecution',
r'proceed',
r'cflowbelow',
r'cflow',
r'initialization',
r'preinitialization',
r'staticinitialization',
r'withincode',
r'target',
r'within',
r'execution',
r'getWithinTypeName',
r'handler',
r'thisJoinPoint',
r'thisJoinPointStaticPart',
r'thisEnclosingJoinPointStaticPart',
r'declare',
r'parents',
r'warning',
r'error',
r'soft',
r'precedence',
r'thisAspectInstance',
r'get',
r'set',
r'args',
r'call',
],
relevance: 0,
),
mode8,
],
),
Mode(beginKeywords: r'new throw', relevance: 0),
Mode(
scope: r'function',
begin: r'\w+ +\w+(\.\w+)?\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]',
returnBegin: true,
end: r'[{;=]',
keywords: [
r'false',
r'synchronized',
r'int',
r'abstract',
r'float',
r'private',
r'char',
r'boolean',
r'static',
r'null',
r'if',
r'const',
r'for',
r'true',
r'while',
r'long',
r'throw',
r'strictfp',
r'finally',
r'protected',
r'import',
r'native',
r'final',
r'return',
r'void',
r'enum',
r'else',
r'extends',
r'implements',
r'break',
r'transient',
r'new',
r'catch',
r'instanceof',
r'byte',
r'super',
r'volatile',
r'case',
r'assert',
r'short',
r'package',
r'default',
r'double',
r'public',
r'try',
r'this',
r'switch',
r'continue',
r'throws',
r'privileged',
r'aspectOf',
r'adviceexecution',
r'proceed',
r'cflowbelow',
r'cflow',
r'initialization',
r'preinitialization',
r'staticinitialization',
r'withincode',
r'target',
r'within',
r'execution',
r'getWithinTypeName',
r'handler',
r'thisJoinPoint',
r'thisJoinPointStaticPart',
r'thisEnclosingJoinPointStaticPart',
r'declare',
r'parents',
r'warning',
r'error',
r'soft',
r'precedence',
r'thisAspectInstance',
],
excludeEnd: true,
contains: [
Mode(
begin: r'[a-zA-Z_]\w*\s*\(',
returnBegin: true,
relevance: 0,
contains: [mode9],
),
Mode(
scope: r'params',
begin: r'\(',
end: r'\)',
relevance: 0,
keywords: [
r'false',
r'synchronized',
r'int',
r'abstract',
r'float',
r'private',
r'char',
r'boolean',
r'static',
r'null',
r'if',
r'const',
r'for',
r'true',
r'while',
r'long',
r'throw',
r'strictfp',
r'finally',
r'protected',
r'import',
r'native',
r'final',
r'return',
r'void',
r'enum',
r'else',
r'extends',
r'implements',
r'break',
r'transient',
r'new',
r'catch',
r'instanceof',
r'byte',
r'super',
r'volatile',
r'case',
r'assert',
r'short',
r'package',
r'default',
r'double',
r'public',
r'try',
r'this',
r'switch',
r'continue',
r'throws',
r'privileged',
r'aspectOf',
r'adviceexecution',
r'proceed',
r'cflowbelow',
r'cflow',
r'initialization',
r'preinitialization',
r'staticinitialization',
r'withincode',
r'target',
r'within',
r'execution',
r'getWithinTypeName',
r'handler',
r'thisJoinPoint',
r'thisJoinPointStaticPart',
r'thisEnclosingJoinPointStaticPart',
r'declare',
r'parents',
r'warning',
r'error',
r'soft',
r'precedence',
r'thisAspectInstance',
],
contains: [mode6, mode8, mode10, mode3],
),
mode0,
mode3,
],
),
mode10,
Mode(scope: r'meta', begin: r'@[A-Za-z]+'),
],
);
}