Author Topic: It would be great if embedded language was user configurable  (Read 2926 times)

sigmund

  • Community Member
  • Posts: 97
  • Hero Points: 9
It would be great if embedded language was user configurable
« on: September 18, 2015, 01:27:54 PM »
It would be great if setting up an embedded language was user configurable.  In C++, I would for instance like to switch to my OpenGL Shading Language lexer inside all 'R"OpenGL_shading_language(' raw string literals.

sigmund

  • Community Member
  • Posts: 97
  • Hero Points: 9
Re: It would be great if embedded language was user configurable
« Reply #1 on: March 13, 2021, 01:28:24 PM »
This is something I would still very much like to see, some 5+ years later...

Or maybe I just do not know how to set it up?  How can I for example teach SlickEdit to switch to use embedded JavaScript color coding in an EM_JS() or EM_ASM() macro invocation in a .cpp file?

https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#interacting-with-code-call-javascript-from-native

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: It would be great if embedded language was user configurable
« Reply #2 on: January 26, 2023, 12:37:38 AM »
I never saw this old post. It is definitely possible to configure custom embedded color coding like you've described. The color coding engine in SlickEdit was redesigned in v21. This new engine does support doing what you want. It's simple to do but not obvious if you've never done it. The best thing to do is to look for an example for any other language.

Look at the color coding profile for D and view the token definition for "q{".  It's near the bottom of the Tokens tab. Select it. That click the Embedded tab to see what settings it's using. This example is D embedded in D but you can specify a different language to embed.  Hopefully, this will make some sense to you. If not, I can help.