diff options
author | sharkdp <davidpeter@web.de> | 2018-09-03 21:49:08 +0200 |
---|---|---|
committer | sharkdp <davidpeter@web.de> | 2018-09-03 21:49:26 +0200 |
commit | 3447ed4def7bee1172f8885cba0cc55440d96a5f (patch) | |
tree | 2307d76fe01560bba0d9f7bfbe603c232c3e8278 /assets/syntaxes/CSV.sublime-syntax | |
parent | 532fb921a629a850236b1799f4c810b390d53a37 (diff) |
Add CSV syntax, closes #254
Diffstat (limited to 'assets/syntaxes/CSV.sublime-syntax')
-rw-r--r-- | assets/syntaxes/CSV.sublime-syntax | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/assets/syntaxes/CSV.sublime-syntax b/assets/syntaxes/CSV.sublime-syntax new file mode 100644 index 00000000..1bbc5b97 --- /dev/null +++ b/assets/syntaxes/CSV.sublime-syntax @@ -0,0 +1,46 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Advanced CSV +file_extensions: + - csv + - tsv +scope: text.advanced_csv +contexts: + main: + - match: (\") + captures: + 1: string.quoted.double.advanced_csv + push: + - meta_scope: meta.quoted.advanced_csv + - match: (\") + captures: + 1: string.quoted.double.advanced_csv + pop: true + - include: main + - match: '(\[([+-]?\d*)(\:)?([+-]?\d*)(\,)?([+-]?\d*)(\:)?([+-]?\d*)\])?\s*([<>v^])?\s*(=)' + captures: + 1: keyword.operator.advanced_csv + 2: constant.numeric.formula.advanced_csv + 4: constant.numeric.formula.advanced_csv + 6: constant.numeric.formula.advanced_csv + 8: constant.numeric.formula.advanced_csv + 9: keyword.operator.advanced_csv + 10: keyword.operator.advanced_csv + push: + - meta_scope: meta.range.advanced_csv + - match: (?=(\")|$) + pop: true + - include: scope:source.python + - match: '(?<=^|,|\s|\")([0-9.eE+-]+)(?=$|,|\s|\")' + scope: meta.number.advanced_csv + captures: + 1: constant.numeric.advanced_csv + - match: '(?<=^|,|\s|\")([^, \t\"]+)(?=$|,|\s|\")' + scope: meta.nonnumber.advanced_csv + captures: + 1: storage.type.advanced_csv + - match: (\,) + scope: meta.delimiter.advanced_csv + captures: + 1: keyword.operator.advanced_csv |