|
117 | 117 | # ^^^^^^^^^^ - comment |
118 | 118 | )) |
119 | 119 |
|
| 120 | +$[ # comment ] |
| 121 | +#^^^^^^^^^^^^^ - comment |
| 122 | + |
120 | 123 | cmd \ |
121 | 124 | # comment after line continuation |
122 | 125 | # <- comment.line.number-sign.shell punctuation.definition.comment.shell |
@@ -4153,6 +4156,13 @@ x="$(( foo++ ))" |
4153 | 4156 | # ^^ keyword |
4154 | 4157 | # ^^ punctuation.section.interpolation.end.shell |
4155 | 4158 |
|
| 4159 | +x="$[ foo++ ]" |
| 4160 | +#^ keyword.operator.assignment.shell |
| 4161 | +# ^ punctuation.definition.variable.shell |
| 4162 | +# ^ punctuation.section.interpolation.begin.shell |
| 4163 | +# ^^ keyword |
| 4164 | +# ^ punctuation.section.interpolation.end.shell |
| 4165 | + |
4156 | 4166 | # These are all legal identifiers for variables. |
4157 | 4167 | alias=hello |
4158 | 4168 | # <- - storage - keyword |
@@ -9164,11 +9174,31 @@ stash) || true) |
9164 | 9174 | # https://www.gnu.org/software/bash/manual/bash.html#Arithmetic-Expansion # |
9165 | 9175 | ############################################################################### |
9166 | 9176 |
|
| 9177 | +$(()) |
| 9178 | +# <- meta.function-call.identifier.shell meta.command.shell meta.interpolation.arithmetic.shell punctuation.definition.variable.shell |
| 9179 | +#^^^^ meta.function-call.identifier.shell meta.command.shell meta.interpolation.arithmetic.shell |
| 9180 | +#^^ punctuation.section.interpolation.begin.shell |
| 9181 | +# ^^ punctuation.section.interpolation.end.shell |
| 9182 | + |
| 9183 | +$(( var + 1 )) |
| 9184 | +# <- meta.function-call.identifier.shell meta.command.shell meta.interpolation.arithmetic.shell punctuation.definition.variable.shell |
| 9185 | +#^^^^^^^^^^^^^ meta.function-call.identifier.shell meta.command.shell meta.interpolation.arithmetic.shell |
| 9186 | +#^^ punctuation.section.interpolation.begin.shell |
| 9187 | +# ^^^ variable.other.readwrite.shell |
| 9188 | +# ^ keyword.operator.arithmetic.shell |
| 9189 | +# ^ meta.number.integer.decimal.shell constant.numeric.value.shell |
| 9190 | +# ^^ punctuation.section.interpolation.end.shell |
| 9191 | + |
9167 | 9192 | : $(()) |
| 9193 | +#^^^^^^ meta.function-call.arguments.shell |
9168 | 9194 | # ^^^^^ meta.string.glob.shell meta.interpolation.arithmetic.shell |
| 9195 | +# ^ punctuation.definition.variable.shell |
| 9196 | +# ^^ punctuation.section.interpolation.begin.shell |
| 9197 | +# ^^ punctuation.section.interpolation.end.shell |
9169 | 9198 |
|
9170 | 9199 | : $(( )) |
9171 | | -# ^^^^^^^ meta.interpolation.arithmetic.shell |
| 9200 | +#^^^^^^^^ meta.function-call.arguments.shell |
| 9201 | +# ^^^^^^^ meta.string.glob.shell meta.interpolation.arithmetic.shell |
9172 | 9202 | # ^ punctuation.definition.variable.shell |
9173 | 9203 | # ^^ punctuation.section.interpolation.begin.shell |
9174 | 9204 | # ^^ punctuation.section.interpolation.end.shell |
@@ -9205,6 +9235,66 @@ stash) || true) |
9205 | 9235 | # ^ punctuation.section.interpolation.end.shell |
9206 | 9236 | # ^^ punctuation.section.interpolation.end.shell |
9207 | 9237 |
|
| 9238 | +$[] |
| 9239 | +# <- meta.function-call.identifier.shell meta.command.shell meta.interpolation.arithmetic.shell.shell punctuation.definition.variable.shell.shell |
| 9240 | +#^^ meta.function-call.identifier.shell meta.command.shell meta.interpolation.arithmetic.shell.shell |
| 9241 | +#^ punctuation.section.interpolation.begin.shell.shell |
| 9242 | +# ^ punctuation.section.interpolation.end.shell.shell |
| 9243 | + |
| 9244 | +$[var + 1] |
| 9245 | +# <- meta.function-call.identifier.shell meta.command.shell meta.interpolation.arithmetic.shell.shell punctuation.definition.variable.shell.shell |
| 9246 | +#^^^^^^^^^ meta.function-call.identifier.shell meta.command.shell meta.interpolation.arithmetic.shell.shell |
| 9247 | +#^ punctuation.section.interpolation.begin.shell.shell |
| 9248 | +# ^^^ variable.other.readwrite.shell |
| 9249 | +# ^ keyword.operator.arithmetic.shell |
| 9250 | +# ^ meta.number.integer.decimal.shell constant.numeric.value.shell |
| 9251 | +# ^ punctuation.section.interpolation.end.shell.shell |
| 9252 | + |
| 9253 | +: $[] |
| 9254 | +#^^^^ meta.function-call.arguments.shell |
| 9255 | +# ^^^ meta.string.glob.shell meta.interpolation.arithmetic.shell.shell |
| 9256 | +# ^ punctuation.definition.variable.shell.shell |
| 9257 | +# ^ punctuation.section.interpolation.begin.shell.shell |
| 9258 | +# ^ punctuation.section.interpolation.end.shell.shell |
| 9259 | + |
| 9260 | +: $[ ] |
| 9261 | +# ^^^^^ meta.string.glob.shell meta.interpolation.arithmetic.shell.shell |
| 9262 | +# ^ punctuation.definition.variable.shell.shell |
| 9263 | +# ^ punctuation.section.interpolation.begin.shell.shell |
| 9264 | +# ^ punctuation.section.interpolation.end.shell.shell |
| 9265 | + |
| 9266 | +: $[ `date +%Y`[2] ] |
| 9267 | +# ^^^^^^^^^^^^^^^^^^ meta.string.glob.shell meta.interpolation.arithmetic.shell |
| 9268 | +# ^ punctuation.definition.variable.shell |
| 9269 | +# ^ punctuation.section.interpolation.begin.shell |
| 9270 | +# ^^^^^^^^^^ meta.interpolation.command.shell |
| 9271 | +# ^ punctuation.section.interpolation.begin.shell |
| 9272 | +# ^ punctuation.section.interpolation.end.shell |
| 9273 | +# ^^^ meta.item-access.shell |
| 9274 | +# ^ punctuation.section.interpolation.end.shell |
| 9275 | + |
| 9276 | +: $[ ${var} + 5 * ($var-1) ] |
| 9277 | +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.glob.shell meta.interpolation.arithmetic.shell.shell |
| 9278 | +# ^ punctuation.definition.variable.shell.shell |
| 9279 | +# ^ punctuation.section.interpolation.begin.shell.shell |
| 9280 | +# ^^^^^^ meta.interpolation.parameter.shell |
| 9281 | +# ^ punctuation.definition.variable.shell |
| 9282 | +# ^ punctuation.section.interpolation.begin.shell |
| 9283 | +# ^^^ variable.other.readwrite.shell |
| 9284 | +# ^ punctuation.section.interpolation.end.shell |
| 9285 | +# ^ keyword.operator.arithmetic.shell |
| 9286 | +# ^ meta.number.integer.decimal.shell constant.numeric.value.shell |
| 9287 | +# ^ keyword.operator.arithmetic.shell |
| 9288 | +# ^^^^^^^^ meta.group.shell |
| 9289 | +# ^ punctuation.section.group.begin.shell |
| 9290 | +# ^^^^ meta.interpolation.parameter.shell variable.other.readwrite.shell |
| 9291 | +# ^ punctuation.definition.variable.shell |
| 9292 | +# ^ keyword.operator.arithmetic.shell |
| 9293 | +# ^ meta.number.integer.decimal.shell constant.numeric.value.shell |
| 9294 | +# ^ punctuation.section.group.end.shell |
| 9295 | +# ^ punctuation.section.interpolation.end.shell.shell |
| 9296 | + |
| 9297 | + |
9208 | 9298 | ############################################################################### |
9209 | 9299 | # 3.5.8.1 Pattern Matching # |
9210 | 9300 | # https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching # |
|
0 commit comments