Menu

#126 sh.jsf -- Recognize command options and path-like things as non-keywords

Unknown
open
nobody
Mercurial
5
2021-01-16
2021-01-15
No

I'm sure this could use improving, but here's a start.

This is a proposed fix to highlighting keyword-looking things in shell scripts as keywords when they are really part of options or paths and should not be highlighted as keywords.

This came up in the following thread:
https://sourceforge.net/p/joe-editor/mailman/joe-editor-general/thread/44ba09bf-31b7-867e-085d-34368a548b28%40gmx.ch/#msg37197125

1 Attachments

Discussion

  • Charles J. Tabony

    [OLD VERSION] Here's an update for considering dashes to be part of identifiers.

     

    Last edit: Charles J. Tabony 2021-01-16
  • Charles J. Tabony

    [LATEST VERSION] Be less greedy with options.

     

    Last edit: Charles J. Tabony 2021-01-16
  • Robert Cummings

    Robert Cummings - 2021-01-15

    Uploading replacement patch to fix issues with options that use assignment and strings with spaces.

     
    • Charles J. Tabony

      I think limiting what characters are considered to be allowed in an option argument is going to give cleaner results. Here's some example input:

      for f in $(ls -tr); do echo $f; done
      

      See my patch above with the comment, "Be less greedy with options", where I swap things so that we have to keep seeing dashes and/or identifier characters to keep parsing something as an option and anything else returns to idle.

       
      • Robert Cummings

        Robert Cummings - 2021-01-16

        Hi Charles,

        It may not have been as obvious as I intended, but my patch includes all of your changes and just fixes one small thing that was broken due to your patch.

        Cheers,
        Rob.

         
        • Charles J. Tabony

          I get that, but I don't know how to modify the patch attached to the ticket, so I have two more attached to comments. The last one already fixed this problem.

           
          • Robert Cummings

            Robert Cummings - 2021-01-16

            Ugh, I just downloaded your patches again to compare against which one I made my changes... I thought I had downloaded the latest but looks like I screwed up and downloaded the first one. Sorry for the confusion and noise you are completely right.

             
          • Robert Cummings

            Robert Cummings - 2021-01-16

            I've removed my attachment to avoid future confusion... might be a good idea to remove your earliest one too :)

             
            • Charles J. Tabony

              Unfortunately, it seems there is no removing or modifying the one attached to the ticket!

               

Log in to post a comment.