ThirdParty/Pygments/pygments/lexers/dotnet.py

changeset 6651
e8f3b5568b21
parent 5713
6762afd9f963
equal deleted inserted replaced
6650:1dd52aa8897c 6651:e8f3b5568b21
56 56
57 # for the range of allowed unicode characters in identifiers, see 57 # for the range of allowed unicode characters in identifiers, see
58 # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf 58 # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
59 59
60 levels = { 60 levels = {
61 'none': '@?[_a-zA-Z]\w*', 61 'none': r'@?[_a-zA-Z]\w*',
62 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + 62 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' +
63 '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 63 '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
64 'Cf', 'Mn', 'Mc') + ']*'), 64 'Cf', 'Mn', 'Mc') + ']*'),
65 'full': ('@?(?:_|[^' + 65 'full': ('@?(?:_|[^' +
66 uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' 66 uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])'
169 169
170 # for the range of allowed unicode characters in identifiers, see 170 # for the range of allowed unicode characters in identifiers, see
171 # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf 171 # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
172 172
173 levels = { 173 levels = {
174 'none': '@?[_a-zA-Z]\w*', 174 'none': r'@?[_a-zA-Z]\w*',
175 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + 175 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' +
176 '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 176 '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
177 'Cf', 'Mn', 'Mc') + ']*'), 177 'Cf', 'Mn', 'Mc') + ']*'),
178 'full': ('@?(?:_|[^' + 178 'full': ('@?(?:_|[^' +
179 uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' 179 uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])'
350 ('[*]/', Comment.Multiline, '#pop'), 350 ('[*]/', Comment.Multiline, '#pop'),
351 ('[^/*]', Comment.Multiline), 351 ('[^/*]', Comment.Multiline),
352 ('[*/]', Comment.Multiline) 352 ('[*/]', Comment.Multiline)
353 ], 353 ],
354 'funcname': [ 354 'funcname': [
355 ('[a-zA-Z_]\w*', Name.Function, '#pop') 355 (r'[a-zA-Z_]\w*', Name.Function, '#pop')
356 ], 356 ],
357 'classname': [ 357 'classname': [
358 ('[a-zA-Z_]\w*', Name.Class, '#pop') 358 (r'[a-zA-Z_]\w*', Name.Class, '#pop')
359 ], 359 ],
360 'namespace': [ 360 'namespace': [
361 ('[a-zA-Z_][\w.]*', Name.Namespace, '#pop') 361 (r'[a-zA-Z_][\w.]*', Name.Namespace, '#pop')
362 ] 362 ]
363 } 363 }
364 364
365 365
366 class VbNetLexer(RegexLexer): 366 class VbNetLexer(RegexLexer):
411 'RaiseEvent', 'ReadOnly', 'ReDim', 'RemoveHandler', 'Resume', 411 'RaiseEvent', 'ReadOnly', 'ReDim', 'RemoveHandler', 'Resume',
412 'Return', 'Select', 'Set', 'Shadows', 'Shared', 'Single', 412 'Return', 'Select', 'Set', 'Shadows', 'Shared', 'Single',
413 'Static', 'Step', 'Stop', 'SyncLock', 'Then', 'Throw', 'To', 413 'Static', 'Step', 'Stop', 'SyncLock', 'Then', 'Throw', 'To',
414 'True', 'Try', 'TryCast', 'Wend', 'Using', 'When', 'While', 414 'True', 'Try', 'TryCast', 'Wend', 'Using', 'When', 'While',
415 'Widening', 'With', 'WithEvents', 'WriteOnly'), 415 'Widening', 'With', 'WithEvents', 'WriteOnly'),
416 prefix='(?<!\.)', suffix=r'\b'), Keyword), 416 prefix=r'(?<!\.)', suffix=r'\b'), Keyword),
417 (r'(?<!\.)End\b', Keyword, 'end'), 417 (r'(?<!\.)End\b', Keyword, 'end'),
418 (r'(?<!\.)(Dim|Const)\b', Keyword, 'dim'), 418 (r'(?<!\.)(Dim|Const)\b', Keyword, 'dim'),
419 (r'(?<!\.)(Function|Sub|Property)(\s+)', 419 (r'(?<!\.)(Function|Sub|Property)(\s+)',
420 bygroups(Keyword, Text), 'funcname'), 420 bygroups(Keyword, Text), 'funcname'),
421 (r'(?<!\.)(Class|Structure|Enum)(\s+)', 421 (r'(?<!\.)(Class|Structure|Enum)(\s+)',
572 'functor', 'include', 'method', 'mixin', 'object', 'parallel', 572 'functor', 'include', 'method', 'mixin', 'object', 'parallel',
573 'process', 'protected', 'pure', 'sealed', 'tailcall', 'trait', 573 'process', 'protected', 'pure', 'sealed', 'tailcall', 'trait',
574 'virtual', 'volatile', 574 'virtual', 'volatile',
575 ] 575 ]
576 keyopts = [ 576 keyopts = [
577 '!=', '#', '&&', '&', '\(', '\)', '\*', '\+', ',', '-\.', 577 '!=', '#', '&&', '&', r'\(', r'\)', r'\*', r'\+', ',', r'-\.',
578 '->', '-', '\.\.', '\.', '::', ':=', ':>', ':', ';;', ';', '<-', 578 '->', '-', r'\.\.', r'\.', '::', ':=', ':>', ':', ';;', ';', '<-',
579 '<\]', '<', '>\]', '>', '\?\?', '\?', '\[<', '\[\|', '\[', '\]', 579 r'<\]', '<', r'>\]', '>', r'\?\?', r'\?', r'\[<', r'\[\|', r'\[', r'\]',
580 '_', '`', '\{', '\|\]', '\|', '\}', '~', '<@@', '<@', '=', '@>', '@@>', 580 '_', '`', r'\{', r'\|\]', r'\|', r'\}', '~', '<@@', '<@', '=', '@>', '@@>',
581 ] 581 ]
582 582
583 operators = r'[!$%&*+\./:<=>?@^|~-]' 583 operators = r'[!$%&*+\./:<=>?@^|~-]'
584 word_operators = ['and', 'or', 'not'] 584 word_operators = ['and', 'or', 'not']
585 prefix_syms = r'[!?~]' 585 prefix_syms = r'[!?~]'

eric ide

mercurial