From 58a4d009fa2c7ea024353d3ae4d44a052297d32a Mon Sep 17 00:00:00 2001 From: Florian Pigorsch Date: Mon, 21 Oct 2019 21:56:24 +0200 Subject: [PATCH 1/2] Add fstab file syntax --- assets/syntaxes/Fstab.sublime-syntax | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 assets/syntaxes/Fstab.sublime-syntax diff --git a/assets/syntaxes/Fstab.sublime-syntax b/assets/syntaxes/Fstab.sublime-syntax new file mode 100644 index 0000000000..ae86c0a1a0 --- /dev/null +++ b/assets/syntaxes/Fstab.sublime-syntax @@ -0,0 +1,22 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: fstab +file_extensions: + - fstab +scope: source.fstab + +contexts: + main: + - match: '^\s*\#.*' + scope: comment.line.number-sign + - match: ^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(0|1)\s+(0|1|2)\s*$ + captures: + 1: entity.name.device.fstab + 2: entity.name.mountpoint.fstab + 3: entity.name.type.fstab + 4: entity.name.options.fstab + 5: constant.numeric.dump.fstab + 6: constant.numeric.pass.fstab + - match: '^.*$' + scope: invalid.illegal.fstab \ No newline at end of file From 753a124ef2310d1c13524e3861febb77b7788afd Mon Sep 17 00:00:00 2001 From: Florian Pigorsch Date: Mon, 21 Oct 2019 22:00:39 +0200 Subject: [PATCH 2/2] Add some comments --- assets/syntaxes/Fstab.sublime-syntax | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/syntaxes/Fstab.sublime-syntax b/assets/syntaxes/Fstab.sublime-syntax index ae86c0a1a0..ec462c2ede 100644 --- a/assets/syntaxes/Fstab.sublime-syntax +++ b/assets/syntaxes/Fstab.sublime-syntax @@ -10,6 +10,7 @@ contexts: main: - match: '^\s*\#.*' scope: comment.line.number-sign + comment: just a comment line - match: ^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(0|1)\s+(0|1|2)\s*$ captures: 1: entity.name.device.fstab @@ -18,5 +19,7 @@ contexts: 4: entity.name.options.fstab 5: constant.numeric.dump.fstab 6: constant.numeric.pass.fstab + comment: a valid fstab line with 6 space-separated token groups - match: '^.*$' - scope: invalid.illegal.fstab \ No newline at end of file + scope: invalid.illegal.fstab + comment: everything else, probably an error