micro icon indicating copy to clipboard operation
micro copied to clipboard

Syntax highlight: empty strings in Julia

Open matbesancon opened this issue 3 years ago • 2 comments

Description of the problem or steps to reproduce

v2 = ""
# all stringified after
v3 = 3

This is linked to how the string regex is defined I believe

Specifications

⟩ micro -version
Version: 2.0.8
Commit hash: cfcb2e45
Compiled on October 06, 2020

OS: Linux Mint 20.1 Terminal: kitty (also happens on gnome)

matbesancon avatar Mar 05 '21 09:03 matbesancon

@matbesancon : the issue still holds - but we can resolve it. there is 2 sections for strings in the julia.yaml (which i suppose is compiled into the static binary), comment them out and paste the unmodified appropriate section from the cpp.yaml and continue your work with :100: the relevant section of julia.yaml is the following:

    # - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^']){1}'"

    - constant.string:
        start: "\"\"\""
        end: "\"\"\""
        # rules: []
        rules:
          - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"


    - constant.string:
        start: "\""
        end: "\""
        skip: "\\\\."
        # rules: []
        rules:
          - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})"

    # - constant.string:
        # start: "\"[^\"]|\"$"
        # end: "\""
        # rules: []

I had a little bit different but related issue with array of strings: image

The substitution described above solved my problem.

czylabsonasa avatar Aug 12 '21 21:08 czylabsonasa

I think my PR (#2415) a while back resolved this issue

Andriamanitra avatar Jun 18 '22 03:06 Andriamanitra