#52 multilple line commands and comments

closed-fixed
7
2008-05-04
2008-04-29
futurdorko
No

If I comment the first line of a multi-line command the editor highlights all the next ones with the blue color, but actually only the first is skipped by the interpreter. That is:

..
# a = b + c + d + e + f \ + g + h
..

will be all in blue, but the line

+ g + h

will throw an error.

There are several solution to fix this bug, but I take the best (and the simplest) one is just not to highlight the next lines.

Cheers

Discussion

  • Sven S.
    Sven S.
    2008-05-02

    Logged In: YES
    user_id=1330711
    Originator: NO

    I agree the second line should not be colored as a comment. Although this seems like a trivial issue, I am actually increasing the bug priority because this may cause wrong (unintended) results in some cases, and I had defined priority 7 for that. (or was it even 8? anyway...)

    -sven

     
  • Sven S.
    Sven S.
    2008-05-02

    • priority: 5 --> 7
     
  • Allin Cottrell
    Allin Cottrell
    2008-05-02

    Logged In: YES
    user_id=330339
    Originator: NO

    This matter is controlled by gtksourceview. We can stop the blue
    "comment" coloration from bleeding onto continued lines, but
    only by removing '\' as an escape character in gretl.lang. If
    we do that, escaped quotes will not come out correctly -- as in

    printf "This is a \"word\"\n"

    but maybe that price is worth paying.

     
  • futurdorko
    futurdorko
    2008-05-04

    Logged In: YES
    user_id=1533827
    Originator: YES

    Alternatively we can automatically add a "#" at the beginning of each continued line. But only if we really care about the quotes withing strings.

     
  • Allin Cottrell
    Allin Cottrell
    2008-05-04

    • assigned_to: nobody --> allin
    • status: open --> closed-fixed
     
  • Allin Cottrell
    Allin Cottrell
    2008-05-04

    Logged In: YES
    user_id=330339
    Originator: NO

    I've modified the version of gtksourceview that is bundled
    with gretl, to handle this point correctly, and have removed
    the option of using an installed version of that library.