Author Topic: B3: Custom colouring  (Read 721 times)

jc44

  • Senior Community Member
  • Posts: 216
  • Hero Points: 15
B3: Custom colouring
« on: September 07, 2017, 11:33:17 am »
Hi

I'm a bit confused by the new colouring options.  Do they allow me to specify symbols for tagging or is that a separate thing?  I have an odd assembly language and I currently have a small bit of slick C that defines labels within it and some coloring for comments and pre-processor statements (inherited from SE21).

I would like to add .set & .macro definitions - can I do that with the new colouring stuff?

.set <var>, <value>

.macro <name>[, <arg>]^
  <body>
.endm

I had a quick play but I didn't get anywhere. Can you give me some pointers please?

Thanks

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4896
  • Hero Points: 399
Re: B3: Custom colouring
« Reply #1 on: September 07, 2017, 02:22:38 pm »
Color coding has no effect on tagging. Sounds like you wrote a proc_search function to tag some symbols (labels). You would need to enhance it to find more symbols.

jc44

  • Senior Community Member
  • Posts: 216
  • Hero Points: 15
Re: B3: Custom colouring
« Reply #2 on: September 07, 2017, 03:04:11 pm »
Fair enough. Is there docn on how to write those functions properly? I just hacked code I found elsewhere without any real understanding.

Thanks

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4896
  • Hero Points: 399
Re: B3: Custom colouring
« Reply #3 on: September 10, 2017, 01:38:46 pm »
Slick-C has a lot of docs. It's best to look at sample Slick-C code and see if anything looks like a good start for you. If you do a multi-file search on "_proc_search(" in the macros directory, you will see a lot of existing examples. antlr_proc_search() is a good simple one. asm_proc_search() is a bit more involved but does illustrate searching for many different kinds of definitions.

Usually a regex is defined to look for the start some possible definitions. Match groups are often used for various pieces of the symbol because they are easy to fetch. Then the tag structure is filled in and inserted into the current context. This is the general idea anyway.