#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 1 of 2)
  • Thorsten Haude
    Thorsten Haude
    2006-08-11

    • assigned_to: nobody --> yooden
     
  • Thorsten Haude
    Thorsten Haude
    2006-08-11

    Logged In: YES
    user_id=119143

    I see no difference between the two examples. Do you use the
    stock pattern? If not, which version do you use? Do you see
    the error if you import the attached pattern set?

     
  • Thorsten Haude
    Thorsten Haude
    2006-08-11

     
    Attachments
  • Alex Schuster
    Alex Schuster
    2006-08-11

    Example of wrong colors

     
    Attachments
  • Alex Schuster
    Alex Schuster
    2006-08-11

    Logged In: YES
    user_id=1282251

    It's all default configuration. Loading the tags file
    shell-2.3.2.pats does not help.

    I made a screenshot, this will explain better what is
    happening.

     
  • Thorsten Haude
    Thorsten Haude
    2006-08-30

     
    Attachments
  • Thorsten Haude
    Thorsten Haude
    2006-08-30

    Logged In: YES
    user_id=119143

    Sorry, I still don't see it. The funny thing is, I tested
    2.3.2, 2.3.3 and NEdit 5.5's 2.2, all look different, all
    have errors, but none like yours.

    I tried to enter a copy of your text, is there a typo? Could
    you attach the text you used (gzipped please)?

     
  • Alex Schuster
    Alex Schuster
    2006-09-04

    Logged In: YES
    user_id=1282251

    There is indeed a typo in my first post, it's $( "$( )" )
    instead of $( "$( ) ). But your version of my example text
    (I attached it now) is correct and looks fine (to you, not
    here). Strange.

    I get the same error under CygWin BTW:

    NEdit 5.5
    Sep 30, 2004

    Built on: Win32, 386, GNU C
    Built at: Oct 16 2004, 06:48:22
    With Motif: 2.1.0 [@(#)GNU/LessTif Version 2.1 Release
    0.93.94]
    Running Motif: 2.1 [unknown]
    Server: The Cygwin/X Project 60802000
    Visual: 8-bit PseudoColor (ID 0x22, Default)
    Locale: C

     
  • Alex Schuster
    Alex Schuster
    2006-09-04

    Example of wrong colors

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-04

    Logged In: YES
    user_id=119143

    Please attach your ~/.nedit/nedit.rc.

     
  • Alex Schuster
    Alex Schuster
    2006-09-04

    Logged In: YES
    user_id=1282251

    I only have an ~/.nedit file which I could attach, but it
    is not the problem as I can delete it, the bug still
    happens in default configuration.

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-04

    Logged In: YES
    user_id=119143

    Sorry, I don't know how to pin this down. I'll attach my
    2.3.2 pattern set, but after what we tried so far, I don't
    expect it to help.

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-04

    • milestone: --> release
    • status: open --> open-works-for-me
     
  • Alex Schuster
    Alex Schuster
    2006-09-04

    Logged In: YES
    user_id=1282251

    It's working now!

    Sorry, I made a mistake when I had tried the first .pats
    file. I thought I had to import it via "Load Tags File",
    and did not know about the -import command line option (and
    still cannot find this in the help) until I saw it as
    example in your new .pats file. I saved the defaults, and
    all is fine now. Thanks!

    The question remains why the default does not work with my
    NEdit installations. And I just tried a RedHat 9 system
    which also shows the problem:

    NEdit 5.3
    Jun 1, 2002

    Built on: Linux, x86, GNU C
    Built at: Jan 25 2003, 00:39:29
    With Motif: 2002 [@(#)Motif Version 2.2.2]
    Running Motif: 2002
    Server: The X.Org Foundation 70000000

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-04

    • status: open-works-for-me --> closed-fixed
     
  • Thorsten Haude
    Thorsten Haude
    2006-09-04

    Logged In: YES
    user_id=119143

    Glad it works now, even if I don't know what's wrong with
    your default pattern. The pattern set will go into the next
    release, so I consider this fixed.

     
  • Alex Schuster
    Alex Schuster
    2006-09-04

    • status: closed-fixed --> open-wont-fix
     
  • Alex Schuster
    Alex Schuster
    2006-09-04

    Logged In: YES
    user_id=1282251

    It's me again :) While converting my backticks into $(), I
    found a similar problem with this construct (also
    attached):

    ` ${foo:+"${foo}"} ` # Text is black
    $( ${foo:+"${foo}"} ) # Text is green

    This happens with Sh_Ksh_Bash.2.3.3.pats only. Without
    any .nedit config file or with shell-2.3.2.pats imported,
    all is fine.

     
  • Alex Schuster
    Alex Schuster
    2006-09-04

    Wrong colors with Sh_Ksh_Bash.2.3.3.pats

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-04

    Logged In: YES
    user_id=119143

    This is a variable inside a double quoted string inside a
    variable inside a command substitution. NEdit does not
    detect this and closes the first variable, mistaking the
    following " as the start of what is poetically called a ncs
    dq string.

    I fixed this, but remember that patterns are not recursive,
    nor modular, so we have to draw the line somewhere. Keep
    your bug reports coming, but don't expect them all to get fixed.

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-04

    • status: open-wont-fix --> closed-fixed
     
  • Alex Schuster
    Alex Schuster
    2006-09-27

    Logged In: YES
    user_id=1282251

    Okay, here's another report then, similar to the first
    one. It seems that the problem with constructs like
    $( "$( )" )
    also occurs without the inner $, like here:
    $( "( )" )

    This happens with the latest .pats file posted here as
    well as with my original NEdit.

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-27

    Logged In: YES
    user_id=119143

    What am I supposed to see?

     
1 2 > >> (Page 1 of 2)