@@ -15,17 +15,17 @@ class CustomLexer(RegexLexer):
15
15
'root' : [
16
16
(u'(^\\ s*[\\ #]+.*)' , bygroups (Generic .Heading )),
17
17
(u'(^\\ s*[\\ #]+\\ s*\\ [[^\\ ]\\ n\\ r]\\ s*].*)' , bygroups (Generic .Heading )),
18
- (u'([^`\\ n\\ r])' , bygroups (String )),
19
- (u'(^```catala$)' , bygroups (String ), 'code' ),
20
- (u'(^```catala-metadata$)' , bygroups (String ), 'code' ),
21
- (u'(^```catala-test-inline$)' , bygroups (String ), 'test' ),
22
- ('(\n |\r |\r \n )' , String ),
23
- ('.' , String ),
18
+ (u'([^`\\ n\\ r])' , bygroups (Text )),
19
+ (u'(^```catala$)' , bygroups (Text ), 'code' ),
20
+ (u'(^```catala-metadata$)' , bygroups (Text ), 'code' ),
21
+ (u'(^```catala-test-inline$)' , bygroups (Text ), 'test' ),
22
+ ('(\n |\r |\r \n )' , Whitespace ),
23
+ ('.' , Text ),
24
24
],
25
25
'code' : [
26
- (u'(^```$)' , bygroups (String ), 'root' ),
26
+ (u'(^```$)' , bygroups (Text ), 'root' ),
27
27
(u'(\\ s*\\ #.*$)' , bygroups (Comment .Single )),
28
- (u'(context|input|output|internal)(\\ s*)(|output)(\\ s+)([a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' ]*)' , bygroups (Keyword .Declaration , String , Keyword .Declaration , String , Name .Variable )),
28
+ (u'(context|input|output|internal)(\\ s*)(|output)(\\ s+)([a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' ]*)' , bygroups (Keyword .Declaration , Whitespace , Keyword .Declaration , Whitespace , Name .Variable )),
29
29
(u'\\ b(match|with\\ s+pattern|but\\ s+replace|fixed|by|decreasing|increasing|varies|with|we\\ s+have|let|in|scope|depends\\ s+on|declaration|includes|content|rule|under\\ s+condition|condition|data|consequence|fulfilled|equals|assertion|definition|state|label|exception)\\ b' , bygroups (Keyword .Reserved )),
30
30
(u'\\ b(contains|number|sum|such\\ s+that|exists|for|all|of|if|then|else|is|list\\ s+empty|among|maximum|minimum|round|combine|initially)\\ b' , bygroups (Keyword .Declaration )),
31
31
(u'(\\ |[0-9]+\\ -[0-9]+\\ -[0-9]+\\ |)' , bygroups (Number .Integer )),
@@ -35,16 +35,16 @@ class CustomLexer(RegexLexer):
35
35
(u'(\\ -\\ >|\\ +\\ .|\\ +\\ @|\\ +\\ ^|\\ +\\ $|\\ +|\\ -\\ .|\\ -\\ @|\\ -\\ ^|\\ -\\ $|\\ -|\\ *\\ .|\\ *\\ @|\\ *\\ ^|\\ *\\ $|\\ *|/\\ .|/\\ @|/\\ $|/|\\ !|>\\ .|>=\\ .|<=\\ .|<\\ .|>\\ @|>=\\ @|<=\\ @|<\\ @|>\\ $|>=\\ $|<=\\ $|<\\ $|>\\ ^|>=\\ ^|<=\\ ^|<\\ ^|>|>=|<=|<|=|not|or|xor|and|\\ $|\u20ac |%|year|month|day)' , bygroups (Operator )),
36
36
(u'\\ b(structure|enumeration|list\\ s+of|integer|boolean|date|duration|money|text|decimal)\\ b' , bygroups (Keyword .Type )),
37
37
(u'\\ b([A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' ]*)(\\ .)([a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' ]*)\\ b' , bygroups (Name .Class , Operator , Name .Variable )),
38
- (u'\\ b([a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' ]*)(\\ .)([a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' \\ .]*)\\ b' , bygroups (Name .Variable , Operator , String )),
38
+ (u'\\ b([a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' ]*)(\\ .)([a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' \\ .]*)\\ b' , bygroups (Name .Variable , Operator , Text )),
39
39
(u'\\ b([a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' ]*)\\ b' , bygroups (Name .Variable )),
40
40
(u'\\ b([A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 ][a-z\xe9 \xe8 \xe0 \xe2 \xf9 \xee \xea \u0153 \xe7 A-Z\xc9 \xc8 \xc0 \xc2 \xd9 \xce \xca \u0152 \xc7 0-9_\\ \' ]*)\\ b' , bygroups (Name .Class )),
41
- ('(\n |\r |\r \n )' , String ),
42
- ('.' , String ),
41
+ ('(\n |\r |\r \n )' , Whitespace ),
42
+ ('.' , Text ),
43
43
],
44
44
'test' : [
45
- (u'(^```$)' , bygroups (String ), 'root' ),
45
+ (u'(^```$)' , bygroups (Text ), 'root' ),
46
46
(u'(^[$] catala \\ S*)' , bygroups (Keyword .Constant )),
47
- ('(\n |\r |\r \n )' , String ),
48
- ('.' , String ),
47
+ ('(\n |\r |\r \n )' , Whitespace ),
48
+ ('.' , Text ),
49
49
]
50
50
}
0 commit comments