19 from pygments import unistring as uni |
19 from pygments import unistring as uni |
20 |
20 |
21 __all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer', |
21 __all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer', |
22 'GroovyLexer', 'IokeLexer', 'ClojureLexer', 'ClojureScriptLexer', |
22 'GroovyLexer', 'IokeLexer', 'ClojureLexer', 'ClojureScriptLexer', |
23 'KotlinLexer', 'XtendLexer', 'AspectJLexer', 'CeylonLexer', |
23 'KotlinLexer', 'XtendLexer', 'AspectJLexer', 'CeylonLexer', |
24 'PigLexer', 'GoloLexer', 'JasminLexer'] |
24 'PigLexer', 'GoloLexer', 'JasminLexer', 'SarlLexer'] |
25 |
25 |
26 |
26 |
27 class JavaLexer(RegexLexer): |
27 class JavaLexer(RegexLexer): |
28 """ |
28 """ |
29 For `Java <http://www.sun.com/java/>`_ source code. |
29 For `Java <https://www.oracle.com/technetwork/java/>`_ source code. |
30 """ |
30 """ |
31 |
31 |
32 name = 'Java' |
32 name = 'Java' |
33 aliases = ['java'] |
33 aliases = ['java'] |
34 filenames = ['*.java'] |
34 filenames = ['*.java'] |
48 Keyword), |
48 Keyword), |
49 # method names |
49 # method names |
50 (r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments |
50 (r'((?:(?:[^\W\d]|\$)[\w.\[\]$<>]*\s+)+?)' # return arguments |
51 r'((?:[^\W\d]|\$)[\w$]*)' # method name |
51 r'((?:[^\W\d]|\$)[\w$]*)' # method name |
52 r'(\s*)(\()', # signature start |
52 r'(\s*)(\()', # signature start |
53 bygroups(using(this), Name.Function, Text, Operator)), |
53 bygroups(using(this), Name.Function, Text, Punctuation)), |
54 (r'@[^\W\d][\w.]*', Name.Decorator), |
54 (r'@[^\W\d][\w.]*', Name.Decorator), |
55 (r'(abstract|const|enum|extends|final|implements|native|private|' |
55 (r'(abstract|const|enum|extends|final|implements|native|private|' |
56 r'protected|public|static|strictfp|super|synchronized|throws|' |
56 r'protected|public|static|strictfp|super|synchronized|throws|' |
57 r'transient|volatile)\b', Keyword.Declaration), |
57 r'transient|volatile)\b', Keyword.Declaration), |
58 (r'(boolean|byte|char|double|float|int|long|short|void)\b', |
58 (r'(boolean|byte|char|double|float|int|long|short|void)\b', |
59 Keyword.Type), |
59 Keyword.Type), |
60 (r'(package)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), |
60 (r'(package)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), |
61 (r'(true|false|null)\b', Keyword.Constant), |
61 (r'(true|false|null)\b', Keyword.Constant), |
62 (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), |
62 (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), |
63 'class'), |
63 'class'), |
|
64 (r'(var)(\s+)', bygroups(Keyword.Declaration, Text), |
|
65 'var'), |
64 (r'(import(?:\s+static)?)(\s+)', bygroups(Keyword.Namespace, Text), |
66 (r'(import(?:\s+static)?)(\s+)', bygroups(Keyword.Namespace, Text), |
65 'import'), |
67 'import'), |
66 (r'"(\\\\|\\"|[^"])*"', String), |
68 (r'"(\\\\|\\"|[^"])*"', String), |
67 (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), |
69 (r"'\\.'|'[^\\]'|'\\u[0-9a-fA-F]{4}'", String.Char), |
68 (r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Operator, Name.Attribute)), |
70 (r'(\.)((?:[^\W\d]|\$)[\w$]*)', bygroups(Punctuation, |
|
71 Name.Attribute)), |
69 (r'^\s*([^\W\d]|\$)[\w$]*:', Name.Label), |
72 (r'^\s*([^\W\d]|\$)[\w$]*:', Name.Label), |
70 (r'([^\W\d]|\$)[\w$]*', Name), |
73 (r'([^\W\d]|\$)[\w$]*', Name), |
71 (r'([0-9][0-9_]*\.([0-9][0-9_]*)?|' |
74 (r'([0-9][0-9_]*\.([0-9][0-9_]*)?|' |
72 r'\.[0-9][0-9_]*)' |
75 r'\.[0-9][0-9_]*)' |
73 r'([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|' |
76 r'([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|' |
78 r'[pP][+\-]?[0-9][0-9_]*[fFdD]?', Number.Float), |
81 r'[pP][+\-]?[0-9][0-9_]*[fFdD]?', Number.Float), |
79 (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?', Number.Hex), |
82 (r'0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?', Number.Hex), |
80 (r'0[bB][01][01_]*[lL]?', Number.Bin), |
83 (r'0[bB][01][01_]*[lL]?', Number.Bin), |
81 (r'0[0-7_]+[lL]?', Number.Oct), |
84 (r'0[0-7_]+[lL]?', Number.Oct), |
82 (r'0|[1-9][0-9_]*[lL]?', Number.Integer), |
85 (r'0|[1-9][0-9_]*[lL]?', Number.Integer), |
83 (r'[~^*!%&\[\](){}<>|+=:;,./?-]', Operator), |
86 (r'[~^*!%&\[\]<>|+=/?-]', Operator), |
|
87 (r'[{}();:.,]', Punctuation), |
84 (r'\n', Text) |
88 (r'\n', Text) |
85 ], |
89 ], |
86 'class': [ |
90 'class': [ |
87 (r'([^\W\d]|\$)[\w$]*', Name.Class, '#pop') |
91 (r'([^\W\d]|\$)[\w$]*', Name.Class, '#pop') |
|
92 ], |
|
93 'var': [ |
|
94 (r'([^\W\d]|\$)[\w$]*', Name, '#pop') |
88 ], |
95 ], |
89 'import': [ |
96 'import': [ |
90 (r'[\w.]+\*?', Name.Namespace, '#pop') |
97 (r'[\w.]+\*?', Name.Namespace, '#pop') |
91 ], |
98 ], |
92 } |
99 } |
102 name = 'AspectJ' |
109 name = 'AspectJ' |
103 aliases = ['aspectj'] |
110 aliases = ['aspectj'] |
104 filenames = ['*.aj'] |
111 filenames = ['*.aj'] |
105 mimetypes = ['text/x-aspectj'] |
112 mimetypes = ['text/x-aspectj'] |
106 |
113 |
107 aj_keywords = set(( |
114 aj_keywords = { |
108 'aspect', 'pointcut', 'privileged', 'call', 'execution', |
115 'aspect', 'pointcut', 'privileged', 'call', 'execution', |
109 'initialization', 'preinitialization', 'handler', 'get', 'set', |
116 'initialization', 'preinitialization', 'handler', 'get', 'set', |
110 'staticinitialization', 'target', 'args', 'within', 'withincode', |
117 'staticinitialization', 'target', 'args', 'within', 'withincode', |
111 'cflow', 'cflowbelow', 'annotation', 'before', 'after', 'around', |
118 'cflow', 'cflowbelow', 'annotation', 'before', 'after', 'around', |
112 'proceed', 'throwing', 'returning', 'adviceexecution', 'declare', |
119 'proceed', 'throwing', 'returning', 'adviceexecution', 'declare', |
113 'parents', 'warning', 'error', 'soft', 'precedence', 'thisJoinPoint', |
120 'parents', 'warning', 'error', 'soft', 'precedence', 'thisJoinPoint', |
114 'thisJoinPointStaticPart', 'thisEnclosingJoinPointStaticPart', |
121 'thisJoinPointStaticPart', 'thisEnclosingJoinPointStaticPart', |
115 'issingleton', 'perthis', 'pertarget', 'percflow', 'percflowbelow', |
122 'issingleton', 'perthis', 'pertarget', 'percflow', 'percflowbelow', |
116 'pertypewithin', 'lock', 'unlock', 'thisAspectInstance' |
123 'pertypewithin', 'lock', 'unlock', 'thisAspectInstance' |
117 )) |
124 } |
118 aj_inter_type = set(('parents:', 'warning:', 'error:', 'soft:', 'precedence:')) |
125 aj_inter_type = {'parents:', 'warning:', 'error:', 'soft:', 'precedence:'} |
119 aj_inter_type_annotation = set(('@type', '@method', '@constructor', '@field')) |
126 aj_inter_type_annotation = {'@type', '@method', '@constructor', '@field'} |
120 |
127 |
121 def get_tokens_unprocessed(self, text): |
128 def get_tokens_unprocessed(self, text): |
122 for index, token, value in JavaLexer.get_tokens_unprocessed(self, text): |
129 for index, token, value in JavaLexer.get_tokens_unprocessed(self, text): |
123 if token is Name and value in self.aj_keywords: |
130 if token is Name and value in self.aj_keywords: |
124 yield index, Keyword, value |
131 yield index, Keyword, value |
298 (r'[0-9]+L?', Number.Integer), |
304 (r'[0-9]+L?', Number.Integer), |
299 (r'\n', Text) |
305 (r'\n', Text) |
300 ], |
306 ], |
301 'class': [ |
307 'class': [ |
302 (u'(%s|%s|`[^`]+`)(\\s*)(\\[)' % (idrest, op), |
308 (u'(%s|%s|`[^`]+`)(\\s*)(\\[)' % (idrest, op), |
303 bygroups(Name.Class, Text, Operator), 'typeparam'), |
309 bygroups(Name.Class, Text, Operator), ('#pop', 'typeparam')), |
304 (r'\s+', Text), |
310 (r'\s+', Text), |
|
311 include('comments'), |
305 (r'\{', Operator, '#pop'), |
312 (r'\{', Operator, '#pop'), |
306 (r'\(', Operator, '#pop'), |
313 (r'\(', Operator, '#pop'), |
307 (r'//.*?\n', Comment.Single, '#pop'), |
|
308 (u'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'), |
314 (u'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'), |
309 ], |
315 ], |
310 'type': [ |
316 'type': [ |
311 (r'\s+', Text), |
317 (r'\s+', Text), |
312 (r'<[%:]|>:|[#_]|forSome|type', Keyword), |
318 include('comments'), |
|
319 (r'<[%:]|>:|[#_]|\bforSome\b|\btype\b', Keyword), |
313 (u'([,);}]|=>|=|\u21d2)(\\s*)', bygroups(Operator, Text), '#pop'), |
320 (u'([,);}]|=>|=|\u21d2)(\\s*)', bygroups(Operator, Text), '#pop'), |
314 (r'[({]', Operator, '#push'), |
321 (r'[({]', Operator, '#push'), |
315 (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)(\\[)' % |
322 (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)(\\[)' % |
316 (idrest, op, idrest, op), |
323 (idrest, op, idrest, op), |
317 bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')), |
324 bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')), |
318 (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)$' % |
325 (u'((?:%s|%s|`[^`]+`)(?:\\.(?:%s|%s|`[^`]+`))*)(\\s*)$' % |
319 (idrest, op, idrest, op), |
326 (idrest, op, idrest, op), |
320 bygroups(Keyword.Type, Text), '#pop'), |
327 bygroups(Keyword.Type, Text), '#pop'), |
321 (r'//.*?\n', Comment.Single, '#pop'), |
|
322 (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) |
328 (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) |
323 ], |
329 ], |
324 'typeparam': [ |
330 'typeparam': [ |
325 (r'[\s,]+', Text), |
331 (r'\s+', Text), |
326 (u'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword), |
332 include('comments'), |
|
333 (r',+', Punctuation), |
|
334 (u'<[%:]|=>|>:|[#_\u21D2]|\bforSome\b|\btype\b', Keyword), |
327 (r'([\])}])', Operator, '#pop'), |
335 (r'([\])}])', Operator, '#pop'), |
328 (r'[(\[{]', Operator, '#push'), |
336 (r'[(\[{]', Operator, '#push'), |
329 (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) |
337 (u'\\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type) |
|
338 ], |
|
339 'comments': [ |
|
340 (r'//.*?\n', Comment.Single), |
|
341 (r'/\*', Comment.Multiline, 'comment'), |
330 ], |
342 ], |
331 'comment': [ |
343 'comment': [ |
332 (r'[^/*]+', Comment.Multiline), |
344 (r'[^/*]+', Comment.Multiline), |
333 (r'/\*', Comment.Multiline, '#push'), |
345 (r'/\*', Comment.Multiline, '#push'), |
334 (r'\*/', Comment.Multiline, '#pop'), |
346 (r'\*/', Comment.Multiline, '#pop'), |
1004 For `Kotlin <http://kotlinlang.org/>`_ |
1016 For `Kotlin <http://kotlinlang.org/>`_ |
1005 source code. |
1017 source code. |
1006 |
1018 |
1007 .. versionadded:: 1.5 |
1019 .. versionadded:: 1.5 |
1008 """ |
1020 """ |
1009 |
1021 |
1010 name = 'Kotlin' |
1022 name = 'Kotlin' |
1011 aliases = ['kotlin'] |
1023 aliases = ['kotlin'] |
1012 filenames = ['*.kt'] |
1024 filenames = ['*.kt'] |
1013 mimetypes = ['text/x-kotlin'] |
1025 mimetypes = ['text/x-kotlin'] |
1014 |
1026 |
1015 flags = re.MULTILINE | re.DOTALL | re.UNICODE |
1027 flags = re.MULTILINE | re.DOTALL | re.UNICODE |
1016 |
1028 |
1017 kt_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + |
1029 kt_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + |
1018 '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', |
1030 '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', |
1019 'Mn', 'Mc') + ']*') |
1031 'Mn', 'Mc') + ']*') |
1020 kt_id = '(' + kt_name + '|`' + kt_name + '`)' |
1032 |
|
1033 kt_space_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + |
|
1034 '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', |
|
1035 'Mn', 'Mc', 'Zs') + ',-]*') |
|
1036 |
|
1037 kt_id = '(' + kt_name + '|`' + kt_space_name + '`)' |
1021 |
1038 |
1022 tokens = { |
1039 tokens = { |
1023 'root': [ |
1040 'root': [ |
1024 (r'^\s*\[.*?\]', Name.Attribute), |
1041 (r'^\s*\[.*?\]', Name.Attribute), |
1025 (r'[^\S\n]+', Text), |
1042 (r'[^\S\n]+', Text), |
|
1043 (r'\s+', Text), |
1026 (r'\\\n', Text), # line continuation |
1044 (r'\\\n', Text), # line continuation |
1027 (r'//.*?\n', Comment.Single), |
1045 (r'//.*?\n', Comment.Single), |
1028 (r'/[*].*?[*]/', Comment.Multiline), |
1046 (r'/[*].*?[*]/', Comment.Multiline), |
|
1047 (r'""".*?"""', String), |
1029 (r'\n', Text), |
1048 (r'\n', Text), |
1030 (r'::|!!|\?[:.]', Operator), |
1049 (r'::|!!|\?[:.]', Operator), |
1031 (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation), |
1050 (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation), |
1032 (r'[{}]', Punctuation), |
1051 (r'[{}]', Punctuation), |
1033 (r'@"(""|[^"])*"', String), |
1052 (r'@"(""|[^"])*"', String), |
1034 (r'"(\\\\|\\"|[^"\n])*["\n]', String), |
1053 (r'"(\\\\|\\"|[^"\n])*["\n]', String), |
1035 (r"'\\.'|'[^\\]'", String.Char), |
1054 (r"'\\.'|'[^\\]'", String.Char), |
1036 (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFL]?|" |
1055 (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFL]?|" |
1037 r"0[xX][0-9a-fA-F]+[Ll]?", Number), |
1056 r"0[xX][0-9a-fA-F]+[Ll]?", Number), |
1038 (r'(class)(\s+)(object)', bygroups(Keyword, Text, Keyword)), |
1057 (r'(object)(\s+)(:)(\s+)', bygroups(Keyword, Text, Punctuation, Text), 'class'), |
|
1058 (r'(companion)(\s+)(object)', bygroups(Keyword, Text, Keyword)), |
1039 (r'(class|interface|object)(\s+)', bygroups(Keyword, Text), 'class'), |
1059 (r'(class|interface|object)(\s+)', bygroups(Keyword, Text), 'class'), |
1040 (r'(package|import)(\s+)', bygroups(Keyword, Text), 'package'), |
1060 (r'(package|import)(\s+)', bygroups(Keyword, Text), 'package'), |
|
1061 (r'(val|var)(\s+)([(])', bygroups(Keyword, Text, Punctuation), 'property_dec'), |
1041 (r'(val|var)(\s+)', bygroups(Keyword, Text), 'property'), |
1062 (r'(val|var)(\s+)', bygroups(Keyword, Text), 'property'), |
1042 (r'(fun)(\s+)', bygroups(Keyword, Text), 'function'), |
1063 (r'(fun)(\s+)', bygroups(Keyword, Text), 'function'), |
|
1064 (r'(inline fun)(\s+)', bygroups(Keyword, Text), 'function'), |
1043 (r'(abstract|annotation|as|break|by|catch|class|companion|const|' |
1065 (r'(abstract|annotation|as|break|by|catch|class|companion|const|' |
1044 r'constructor|continue|crossinline|data|do|dynamic|else|enum|' |
1066 r'constructor|continue|crossinline|data|do|dynamic|else|enum|' |
1045 r'external|false|final|finally|for|fun|get|if|import|in|infix|' |
1067 r'external|false|final|finally|for|fun|get|if|import|in|infix|' |
1046 r'inline|inner|interface|internal|is|lateinit|noinline|null|' |
1068 r'inline|inner|interface|internal|is|lateinit|noinline|null|' |
1047 r'object|open|operator|out|override|package|private|protected|' |
1069 r'object|open|operator|out|override|package|private|protected|' |
1056 (kt_id, Name.Class, '#pop') |
1078 (kt_id, Name.Class, '#pop') |
1057 ], |
1079 ], |
1058 'property': [ |
1080 'property': [ |
1059 (kt_id, Name.Property, '#pop') |
1081 (kt_id, Name.Property, '#pop') |
1060 ], |
1082 ], |
|
1083 'property_dec': [ |
|
1084 (r'(,)(\s*)', bygroups(Punctuation, Text)), |
|
1085 (r'(:)(\s*)', bygroups(Punctuation, Text)), |
|
1086 (r'<', Punctuation, 'generic'), |
|
1087 (r'([)])', Punctuation, '#pop'), |
|
1088 (kt_id, Name.Property) |
|
1089 ], |
1061 'function': [ |
1090 'function': [ |
|
1091 (r'<', Punctuation, 'generic'), |
|
1092 (r''+kt_id+'([.])'+kt_id, bygroups(Name.Class, Punctuation, Name.Function), '#pop'), |
1062 (kt_id, Name.Function, '#pop') |
1093 (kt_id, Name.Function, '#pop') |
1063 ], |
1094 ], |
|
1095 'generic': [ |
|
1096 (r'(>)(\s*)', bygroups(Punctuation, Text), '#pop'), |
|
1097 (r':',Punctuation), |
|
1098 (r'(reified|out|in)\b', Keyword), |
|
1099 (r',',Text), |
|
1100 (r'\s+',Text), |
|
1101 (kt_id,Name) |
|
1102 ] |
1064 } |
1103 } |
1065 |
1104 |
1066 |
1105 |
1067 class XtendLexer(RegexLexer): |
1106 class XtendLexer(RegexLexer): |
1068 """ |
1107 """ |
1569 if re.search(r'^\s*\.(attribute|bytecode|debug|deprecated|enclosing|' |
1608 if re.search(r'^\s*\.(attribute|bytecode|debug|deprecated|enclosing|' |
1570 r'inner|interface|limit|set|signature|stack)\b', text, |
1609 r'inner|interface|limit|set|signature|stack)\b', text, |
1571 re.MULTILINE): |
1610 re.MULTILINE): |
1572 score += 0.6 |
1611 score += 0.6 |
1573 return score |
1612 return score |
|
1613 |
|
1614 |
|
1615 class SarlLexer(RegexLexer): |
|
1616 """ |
|
1617 For `SARL <http://www.sarl.io>`_ source code. |
|
1618 |
|
1619 .. versionadded:: 2.4 |
|
1620 """ |
|
1621 |
|
1622 name = 'SARL' |
|
1623 aliases = ['sarl'] |
|
1624 filenames = ['*.sarl'] |
|
1625 mimetypes = ['text/x-sarl'] |
|
1626 |
|
1627 flags = re.MULTILINE | re.DOTALL |
|
1628 |
|
1629 tokens = { |
|
1630 'root': [ |
|
1631 # method names |
|
1632 (r'^(\s*(?:[a-zA-Z_][\w.\[\]]*\s+)+?)' # return arguments |
|
1633 r'([a-zA-Z_$][\w$]*)' # method name |
|
1634 r'(\s*)(\()', # signature start |
|
1635 bygroups(using(this), Name.Function, Text, Operator)), |
|
1636 (r'[^\S\n]+', Text), |
|
1637 (r'//.*?\n', Comment.Single), |
|
1638 (r'/\*.*?\*/', Comment.Multiline), |
|
1639 (r'@[a-zA-Z_][\w.]*', Name.Decorator), |
|
1640 (r'(as|break|case|catch|default|do|else|extends|extension|finally|fires|for|if|implements|instanceof|new|on|requires|return|super|switch|throw|throws|try|typeof|uses|while|with)\b', |
|
1641 Keyword), |
|
1642 (r'(abstract|def|dispatch|final|native|override|private|protected|public|static|strictfp|synchronized|transient|val|var|volatile)\b', Keyword.Declaration), |
|
1643 (r'(boolean|byte|char|double|float|int|long|short|void)\b', |
|
1644 Keyword.Type), |
|
1645 (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)), |
|
1646 (r'(false|it|null|occurrence|this|true|void)\b', Keyword.Constant), |
|
1647 (r'(agent|annotation|artifact|behavior|capacity|class|enum|event|interface|skill|space)(\s+)', bygroups(Keyword.Declaration, Text), |
|
1648 'class'), |
|
1649 (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'), |
|
1650 (r'"(\\\\|\\"|[^"])*"', String), |
|
1651 (r"'(\\\\|\\'|[^'])*'", String), |
|
1652 (r'[a-zA-Z_]\w*:', Name.Label), |
|
1653 (r'[a-zA-Z_$]\w*', Name), |
|
1654 (r'[~^*!%&\[\](){}<>\|+=:;,./?-]', Operator), |
|
1655 (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), |
|
1656 (r'0x[0-9a-fA-F]+', Number.Hex), |
|
1657 (r'[0-9]+L?', Number.Integer), |
|
1658 (r'\n', Text) |
|
1659 ], |
|
1660 'class': [ |
|
1661 (r'[a-zA-Z_]\w*', Name.Class, '#pop') |
|
1662 ], |
|
1663 'import': [ |
|
1664 (r'[\w.]+\*?', Name.Namespace, '#pop') |
|
1665 ], |
|
1666 } |