Skip to content

] in parameter expansion causes error #274

Open

Description

@rivke41levp656

Look at the following script:

#!/bin/bash

# comment is grey — syntax highlighting works
temp="${temp%]*}"

# comment is not grey — syntax highlighting is broken here

: "$"
# comment is grey again — syntax highlighting somehow restored

tree output:

(program ; [0, 0] - [9, 0]
  (comment) ; [0, 0] - [0, 11]
  (comment) ; [2, 0] - [2, 51]
  (variable_assignment ; [3, 0] - [7, 5]
    name: (variable_name) ; [3, 0] - [3, 4]
    value: (string ; [3, 5] - [7, 5]
      (expansion ; [3, 6] - [7, 3]
        (variable_name) ; [3, 8] - [3, 12]
        (ERROR ; [3, 13] - [3, 16]
          (word)) ; [3, 13] - [3, 15]
        (string ; [3, 16] - [7, 3]
          (string_content) ; [5, 0] - [5, 60]
          (string_content))))) ; [7, 0] - [7, 2]
  (comment)) ; [8, 0] - [8, 64]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions