Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Unclosed bracket in triple-quoted raw string breaks highlighting #39

Open

Description

@aroben

This is basically the same as #37 except for triple-quoted raw strings.

screen shot 2014-11-21 at 4 38 42 pm

#foo above should be highlighted as a comment. Instead, it and everything else that comes later in the file will get highlighted as if it were a regex. The grammar doesn't see that the raw string got closed at the closing triple-quote, so is happily consuming everything into the string.

The rules for triple-quoted strings use begin/end to make them work over multiple lines. We could fix the single-line case by adding near-duplicate match rules ("match": "r\"\"\"(.*)\"\"\" e.g.). But the multi-line case would still be broken:

screen shot 2014-11-21 at 4 40 56 pm

I'm not sure how to fix the multi-line case given the way grammars currently work.

Activity

  1. southgate commented on Jan 13, 2015

    @southgate

    Highlighting gets screwy with an open parens ( too. Related?

    image

  2. aroben commented on Jan 14, 2015

    @aroben
    ContributorAuthor

    Yeah almost certainly the same issue.

  3. pchaigno commented on Sep 7, 2015

    @pchaigno
    Contributor

    I'm not sure how to fix the multi-line case given the way grammars currently work.

    Is it even possible? If it's not, maybe we should fix this instead of supporting regular expressions on several lines in triple-quoted strings?

  4. self-assigned this
    on Oct 6, 2015
  5. removed their assignment
    on Aug 4, 2016
  6. Fuzl commented on Sep 16, 2016

    @Fuzl

    Other odd behaviour breaking the block comment :
    broken

    Without quotes, SELECT (uppercase only) keyword does not break block comments, but seams to trigger formating although inside block comments :
    broken2
    broken3

    Would it be related ?

  7. Fuzl commented on Sep 16, 2016

    @Fuzl

    Following #109 I fetched package magicpython and deactivated language-python.
    It all works correctly now.
    ;o)

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions