Skip to content

Quoted strings/here-strings issues #167

Closed
@msftrncs

Description

@msftrncs

Adding to issue #143,

  1. Both double-quote and single-quote here-strings fail to tolerate trailing space on the opening line. Users might only notice the @ not highlighted, because regular quoted string still fires, but if any further quotes are used in the here-string, they will cause highlighting issues.
  2. Single-quoted strings fail to highlight, if immediately following a backtick'd single-quote. Example:
    echo `''hello there'
    This statement outputs 'hello there.
    (a) This statement highlights incorrectly because the begin regex incorrectly requires a match of a single-quote to which is not preceded by single-quote. This is flawed because the previous single-quote could be backticked. In reality the check for a prior single-quote is unneeded.
    (b) Likewise the end regex requires matching a single quote not followed by another single quote, but this requirement can be eliminated by using the TextMate applyEndPatternLast property, setting it to true.
  3. (a) Double quoted strings do not exhibit a similar behavior because the begin regex already checked for a backtick before the double-quote that cannot be before the real double-quote. But that logic is flawed. The backtick may have been backtick'd. However, it works, because, the need to check for a preceding double-quote is unnecessary.
    (b) The end match for double-quoted strings can benefit from the same property as the single-quoted string.
  4. Both double-quote and single-quote here-strings fail to scope the begin and end tokens as punctuation.

NOTE: these are relatively minor issues overall.

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