Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pygments/lexers/tlb.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-01 06:54 +0000

1""" 

2 pygments.lexers.tlb 

3 ~~~~~~~~~~~~~~~~~~~ 

4 

5 Lexers for TL-b. 

6 

7 :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. 

8 :license: BSD, see LICENSE for details. 

9""" 

10 

11from pygments.lexer import RegexLexer, include, words 

12from pygments.token import Operator, Name, \ 

13 Number, Whitespace, Punctuation, Comment 

14 

15__all__ = ['TlbLexer'] 

16 

17 

18class TlbLexer(RegexLexer): 

19 """ 

20 For TL-b source code. 

21 """ 

22 

23 name = 'Tl-b' 

24 aliases = ['tlb'] 

25 filenames = ['*.tlb'] 

26 

27 tokens = { 

28 'root': [ 

29 (r'\s+', Whitespace), 

30 

31 include('comments'), 

32 

33 (r'[0-9]+', Number), 

34 (words(( 

35 '+', '-', '*', '=', '?', '~', '.', 

36 '^', '==', '<', '>', '<=', '>=', '!=' 

37 )), Operator), 

38 (words(('##', '#<', '#<=')), Name.Tag), 

39 (r'#[0-9a-f]*_?', Name.Tag), 

40 (r'\$[01]*_?', Name.Tag), 

41 

42 (r'[a-zA-Z_][0-9a-zA-Z_]*', Name), 

43 

44 (r'[;():\[\]{}]', Punctuation) 

45 ], 

46 

47 'comments': [ 

48 (r'//.*', Comment.Singleline), 

49 (r'/\*', Comment.Multiline, 'comment'), 

50 ], 

51 'comment': [ 

52 (r'[^/*]+', Comment.Multiline), 

53 (r'/\*', Comment.Multiline, '#push'), 

54 (r'\*/', Comment.Multiline, '#pop'), 

55 (r'[*/]', Comment.Multiline), 

56 ], 

57 }