@@ -8,18 +8,126 @@ scope: source.fstab
11− - match: '^\s*\#.*'
12+ - match: '^'
12− scope: comment.line.number-sign
13+ push: fstab_device
13− comment: just a comment line
14+ comment: leading spaces
14− - match: ^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(0|1)\s+(0|1|2)\s*$
18+ - match: '\s*([^=\s]+=)([^\s]+)\s*'
19+ comment: device by uuid or label
20+ set: fstab_mountpoint
22+ 1: punctuation.accessor
23+ 2: keyword.other.device
24+ - match: '\s*(//|\\\\)([^\s]+)\s*'
25+ comment: device by samba share
26+ set: fstab_mountpoint
28+ 1: punctuation.accessor
29+ 2: keyword.other.device
30+ - match: '\s*([^\s]+)(:)([^\s]+)\s*'
31+ comment: device by server
32+ set: fstab_mountpoint
34+ 1: keyword.other.device
35+ 2: punctuation.accessor
36+ 3: keyword.other.device
37+ - match: '\s*[^\s/\\]+\s*'
38+ comment: device by dev name
39+ set: fstab_mountpoint
40+ scope: keyword.other.device
41+ - match: '\s*(/dev/)([^\s]+)\s*'
42+ comment: device by dev path
43+ set: fstab_mountpoint
45+ 1: punctuation.accessor
46+ 2: keyword.other.device
47+ - match: '\s*([^\s/]*/)*([^\s]+)\s*'
48+ comment: device by unknown path
49+ set: fstab_mountpoint
51+ 1: punctuation.accessor
52+ 2: keyword.other.device
57+ - match: '\s*/[^\s]*\s*'
59+ set: fstab_filesystem
60+ scope: string.unquoted.mountpoint
61+ - match: '\s*[^\s]+\s*'
62+ comment: mount point without leading slash (invalid)
63+ set: fstab_filesystem
64+ scope: invalid.illegal
69+ - match: '\s*[^\s]+\s*'
70+ comment: filesystem type
72+ scope: variable.parameter.filesystem
77+ - match: '([^\s,=]+)(=)([^\s,]+)'
78+ comment: key-value option
16− 1: entity.name.device.fstab
80+ 1: entity.name.option
17− 2: entity.name.mountpoint.fstab
81+ 2: entity.other.separator
18− 3: entity.name.type.fstab
82+ 3: variable.parameter
19− 4: entity.name.options.fstab
85+ scope: entity.name.option
87+ comment: option separator
88+ scope: punctuation.separator
96+ - match: '\s*[01]\s*'
20− 5: constant.numeric.dump.fstab
98+ scope: constant.numeric
100+ - match: '\s*[^\s]+\s*'
101+ comment: invalid dump field
102+ scope: invalid.illegal
108+ - match: '\s*[01]\s*'
21− 6: constant.numeric.pass.fstab
110+ scope: constant.numeric
22− comment: a valid fstab line with 6 space-separated token groups
111+ set: expected_eol
112+ - match: '\s*[^\s]+\s*'
113+ comment: invalid pass field
114+ scope: invalid.illegal
122+ scope: invalid.illegal
126+ comment: comment using the number sign
23− - match: '^.*$'
130+ - match: '.*$'
24− scope: invalid.illegal.fstab
131+ comment: used for clearing the context
25− comment: everything else, probably an error
132+ pop: true