forked from ericmartel/Sublime-Text-2-CSV-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 14
/
AdvancedCSV.YAML-tmLanguage
45 lines (39 loc) · 1.4 KB
/
AdvancedCSV.YAML-tmLanguage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Advanced CSV
fileTypes: [csv, tsv]
scopeName: text.advanced_csv
uuid: 7ce133ea-e34b-47d9-a03c-341293337c88
patterns:
- name: meta.quoted.advanced_csv
begin: (\")
end: (\")
captures:
'1': {name: string.quoted.double.advanced_csv}
patterns:
- include: '$self'
- name: meta.range.advanced_csv
begin: (\[([+-]?\d*)(\:)?([+-]?\d*)(\,)?([+-]?\d*)(\:)?([+-]?\d*)\])?\s*([<>v^])?\s*(=)
beginCaptures:
'1': {name: keyword.operator.advanced_csv} # range
'2': {name: constant.numeric.formula.advanced_csv} # row_begin
'4': {name: constant.numeric.formula.advanced_csv} # row_end
'6': {name: constant.numeric.formula.advanced_csv} # col_begin
'8': {name: constant.numeric.formula.advanced_csv} # col_end
'9': {name: keyword.operator.advanced_csv} # direction
'10': {name: keyword.operator.advanced_csv} # equals
end: (?=(\")|$)
patterns:
- include: source.python
- name: meta.number.advanced_csv
match: (?<=^|,|\s|\")([0-9.eE+-]+)(?=$|,|\s|\")
captures:
'1': {name: constant.numeric.advanced_csv}
- name: meta.nonnumber.advanced_csv
match: (?<=^|,|\s|\")([^, \t\"]+)(?=$|,|\s|\")
captures:
'1': {name: storage.type.advanced_csv}
- name: meta.delimiter.advanced_csv
match: (\,)
captures:
'1': {name: keyword.operator.advanced_csv}