Author Topic: Here documents  (Read 169 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2191
  • Hero Points: 192
  • Text
Here documents
« on: May 04, 2021, 05:35:42 pm »
In Powershell the termination of a here string, @", must be at the start of a line.
Slickedit colors it even if it isn't at the start of a line.

Bash scripts get colored correctly in this case.

Also, I found that in
        Tools > Options > Languages > Scripting Languages > Bourne Shell > Color Coding
The "Here document" check box is not checked.
I didn't find any languages where it is checked.
Does it do anything?


Powershell here strings are colored due to Tokens rules, but Shell scripts seem to do it some other mysterious way.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5777
  • Hero Points: 461
Re: Here documents
« Reply #1 on: May 05, 2021, 03:24:53 pm »
Some languages have "built-in" color coding items that are added after processing user defined items. This is for backward compatibility and sometimes to simplify the color coding definitions (regex can be quite complicated). In other cases, it's because the language can't  be supported by the standard color coding engine (HTML/XML/Markdown and a few others). The here document check box either adds some "built-in" here document items specific to that language or adds a default item. The here document check box wouldn't be needed any more if the items were added to the system color coding definitions for the language. Those regex are a bit scary though.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5777
  • Hero Points: 461
Re: Here documents
« Reply #2 on: May 05, 2021, 05:35:39 pm »
Added hot fix for powershell @" string