Skip to content

Commit 8c18fbc

Browse files
committed
Shuffled the token classes, OCD style
1 parent 309c28f commit 8c18fbc

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

csvlexer/csv.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,31 @@ class CsvLexer(RegexLexer):
4141
(r'^[^,\n]*', Operator, 'second'),
4242
],
4343
'second': [
44-
(r'(,)([^,\n]*)', bygroups(Punctuation, Literal.Number), 'third'),
44+
(r'(,)([^,\n]*)', bygroups(Punctuation, Name.Constant), 'third'),
4545
],
4646
'third': [
47-
(r'(,)([^,\n]*)', bygroups(Punctuation, Keyword), 'fourth'),
47+
(r'(,)([^,\n]*)', bygroups(Punctuation, Keyword.Declaration), 'fourth'),
4848
],
4949
'fourth': [
50-
(r'(,)([^,\n]*)', bygroups(Punctuation, Name.Constant), 'fifth'),
50+
(r'(,)([^,\n]*)', bygroups(Punctuation, Literal.Number), 'fifth'),
5151
],
5252
'fifth': [
5353
(r'(,)([^,\n]*)', bygroups(Punctuation, Literal.String.Single), 'sixth'),
5454
],
5555
'sixth': [
56-
(r'(,)([^,\n]*)', bygroups(Punctuation, Literal.Number), 'seventh'),
56+
(r'(,)([^,\n]*)', bygroups(Punctuation, Name.Constant), 'seventh'),
5757
],
5858
'seventh': [
59-
(r'(,)([^,\n]*)', bygroups(Punctuation, Keyword), 'eighth'),
59+
(r'(,)([^,\n]*)', bygroups(Punctuation, Keyword.Namespace), 'eighth'),
6060
],
6161
'eighth': [
62-
(r'(,)([^,\n]*)', bygroups(Punctuation, Name.Constant), 'ninth'),
62+
(r'(,)([^,\n]*)', bygroups(Punctuation, Literal.Number), 'ninth'),
6363
],
6464
'ninth': [
65-
(r'(,)([^,\n]*)', bygroups(Punctuation, Literal.String.Single), 'unsupported'),
65+
(r'(,)([^,\n]*)', bygroups(Punctuation, Literal.String.Single), 'tenth'),
66+
],
67+
'tenth': [
68+
(r'(,)([^,\n]*)', bygroups(Punctuation, Keyword.Type), 'unsupported'),
6669
],
6770
'unsupported': [
6871
(r'(.+)', bygroups(Punctuation)),

0 commit comments

Comments
 (0)