ThirdParty/Pygments/pygments/lexers/nimrod.py

changeset 5713
6762afd9f963
parent 4697
c2e9bf425554
equal deleted inserted replaced
5712:f0d08bdeacf4 5713:6762afd9f963
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 """ 2 """
3 pygments.lexers.nimrod 3 pygments.lexers.nimrod
4 ~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexer for the Nimrod language. 6 Lexer for the Nim language (formerly known as Nimrod).
7 7
8 :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import re 12 import re
13 13
18 __all__ = ['NimrodLexer'] 18 __all__ = ['NimrodLexer']
19 19
20 20
21 class NimrodLexer(RegexLexer): 21 class NimrodLexer(RegexLexer):
22 """ 22 """
23 For `Nimrod <http://nimrod-code.org/>`_ source code. 23 For `Nim <http://nim-lang.org/>`_ source code.
24 24
25 .. versionadded:: 1.5 25 .. versionadded:: 1.5
26 """ 26 """
27 27
28 name = 'Nimrod' 28 name = 'Nimrod'
29 aliases = ['nimrod', 'nim'] 29 aliases = ['nim', 'nimrod']
30 filenames = ['*.nim', '*.nimrod'] 30 filenames = ['*.nim', '*.nimrod']
31 mimetypes = ['text/x-nimrod'] 31 mimetypes = ['text/x-nim']
32 32
33 flags = re.MULTILINE | re.IGNORECASE | re.UNICODE 33 flags = re.MULTILINE | re.IGNORECASE | re.UNICODE
34 34
35 def underscorize(words): 35 def underscorize(words):
36 newWords = [] 36 newWords = []
41 newWords.append(new) 41 newWords.append(new)
42 new = "" 42 new = ""
43 return "|".join(newWords) 43 return "|".join(newWords)
44 44
45 keywords = [ 45 keywords = [
46 'addr', 'and', 'as', 'asm', 'atomic', 'bind', 'block', 'break', 46 'addr', 'and', 'as', 'asm', 'atomic', 'bind', 'block', 'break', 'case',
47 'case', 'cast', 'const', 'continue', 'converter', 'discard', 47 'cast', 'concept', 'const', 'continue', 'converter', 'defer', 'discard',
48 'distinct', 'div', 'elif', 'else', 'end', 'enum', 'except', 'finally', 48 'distinct', 'div', 'do', 'elif', 'else', 'end', 'enum', 'except',
49 'for', 'generic', 'if', 'implies', 'in', 'yield', 49 'export', 'finally', 'for', 'func', 'if', 'in', 'yield', 'interface',
50 'is', 'isnot', 'iterator', 'lambda', 'let', 'macro', 'method', 50 'is', 'isnot', 'iterator', 'let', 'macro', 'method', 'mixin', 'mod',
51 'mod', 'not', 'notin', 'object', 'of', 'or', 'out', 'proc', 51 'not', 'notin', 'object', 'of', 'or', 'out', 'proc', 'ptr', 'raise',
52 'ptr', 'raise', 'ref', 'return', 'shl', 'shr', 'template', 'try', 52 'ref', 'return', 'shared', 'shl', 'shr', 'static', 'template', 'try',
53 'tuple', 'type', 'when', 'while', 'with', 'without', 'xor' 53 'tuple', 'type', 'when', 'while', 'with', 'without', 'xor'
54 ] 54 ]
55 55
56 keywordsPseudo = [ 56 keywordsPseudo = [
57 'nil', 'true', 'false' 57 'nil', 'true', 'false'

eric ide

mercurial