Author Topic: User defined language with tags  (Read 1626 times)


  • Senior Community Member
  • Posts: 2128
  • Hero Points: 190
  • Text
User defined language with tags
« on: September 02, 2019, 09:20:35 pm »
I want to add support for mustache (

It has tags like HTML or XML
Code: [Select]
  Text inside of a tag
   Text inside of a tag   {{replacement_macro}}
This is a comment

How can I teach Slick about "{{#" and "{{^"?


  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5606
  • Hero Points: 453
Re: User defined language with tags
« Reply #1 on: September 03, 2019, 01:34:52 am »
You should probably try come up with color coding first. The color coding engine doesn't yet have the ability to make a single regex with match groups where you can specify different color for different match groups. There are tricks you can play like defining {{# or }} to be symbol color. Then define a regex which matches the id portion (like "person") with look behind to match {{# before the id and colors that a different color. Remember, SlickEdit supports variable length look behind (Perl doesn't). This all depends on how you want things to be colored.

As for begin/end matching, you'll definitely have to write a macro for that. You'll need to write a _<LangId>__find_matching_word (ex. _html_find_matching_word).

Not sure if there is anything else you would want.