#537 sh syntax hilighting: " ignored in $("$())

release
closed-fixed
Program (402)
5
2006-09-04
2006-08-09
Alex Schuster
No

In code like this, the " is being ignored:
$( "$( ) )

Same with $(()) instead of $(). This looks bad after
constructs like these, which I use often:
echo "$( foo "$( cat "$file" )" )"

My workaround: I use backticks for the inner $():
echo "$( foo "` cat "$file" `" )"

NEdit 5.5
Sep 30, 2004

Built on: Linux, Athlon, GNU C
Built at: Feb 20 2005, 02:40:10
With Motif: 2.2.3 [@(#)Motif Version 2.2.3]
Running Motif: 2.2 [unknown]
Server: The X.Org Foundation 70000000
Visual: 24-bit TrueColor (ID 0x23, Default)
Locale: de_DE@euro

Discussion

<< < 1 2 (Page 2 of 2)
  • Alex Schuster
    Alex Schuster
    2006-09-27

    Logged In: YES
    user_id=1282251

    The same effect as in my previous attachement
    nedit-hilight-bug.png. After the $( "()" ) construct, text
    is hilighted green.

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-27

    Logged In: YES
    user_id=119143

    I don't see a problem, sorry.

     
  • Alex Schuster
    Alex Schuster
    2006-09-28

    Logged In: YES
    user_id=1282251

    I made two more snapshots of the text below. The first was
    with my default NEdit (I removed my ~/.nedit directory),
    the second was made after applying your latest .pats file.

    Personally, I do not care much about this and use backticks
    as a workaround, I just thought I'd mention the problem
    with line 3.

    $( "` `" ) # this is okay
    $( "$()" ) # the 2nd " starts hilighting (fixed)
    $( " ()" ) # the 2nd " starts hilighting

    $( "$( "$()" )" ) # adding another level
    "$( "$( "$()" )" )" # adding two "s
    "`"`"`"``"`"`"`" # backticks are no problem

     
  • Alex Schuster
    Alex Schuster
    2006-09-28

    my original NEdit

     
    Attachments
  • Alex Schuster
    Alex Schuster
    2006-09-28

    NEdit with Sh_Ksh_Bash.2.3.5.pats applied

     
    Attachments
  • Thorsten Haude
    Thorsten Haude
    2006-09-29

    Logged In: YES
    user_id=119143

    All lines look fine here (though the last makes me dizzy).
    Also, if I take a closer look I see exactly what I expect:
    The first " in line 3 starts an ncs double quoted string
    pattern, the second " ends it.

    I can't see a reason why this is different in your shots
    except for a broken setup. Please double-check the pattern
    set and any corruption which might have happened. You might
    want to use a macro like this:

    define getPatternInfo
    {
    if ($n_args != 1)
    {
    # Wrong number of arguments
    beep()
    return
    }
    position = $1

    patternInfo = get_pattern_at_pos(position)
    styleInfo = get_style_at_pos(position)

    result = "Pattern Info for Postition " position ":\n\n" \ "Pattern: " patternInfo["pattern"] "\n" \ "Style: " patternInfo["style"] "\n" \ "Color: " styleInfo["color"] "\n" \ "RGB Values: " styleInfo["rgb"] "\n" \ "Bold: " styleInfo["bold"] "\n" \ "Italic: " styleInfo["italic"] "\n" \ "Background: " styleInfo["background"] "\n" \ "Background RGB: " styleInfo["back_rgb"]
    dialog(result, "OK")
    }
    (Watch line breaks done by SourceForge.)

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-29

    Logged In: YES
    user_id=119143

    I see nedit-pats2.3.5.png if I go back to
    Sh_Ksh_Bash.2.3.2.pats. One diff between 2.3.2 and 2.3.3 is
    the addition of ncs double quoted string, so my guess is
    that you use 2.3.2 or something older.

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-29

    Logged In: YES
    user_id=119143

    Note: You can see the version number of the pattern set in
    the README pattern in the Syntax Highlighting Patterns
    dialog. If you pick the right language mode for both the
    document and in this dialog this should be what you actually
    use, regardless of what you imported or not.

     
  • Alex Schuster
    Alex Schuster
    2006-10-15

    Logged In: YES
    user_id=1282251

    SORRY! You are right, I had the wrong pattern file. I
    somehow renamed it, so the last two files were the same.
    Damn, I feel stupid. All seems to be fine now, even with
    more complex patterns.

    Sorry for taking your time.

     
<< < 1 2 (Page 2 of 2)