0

I need to highlight comments on mcedit using syntax file. One line comment begins with "--" and may end with "\n" or with "--". My syntax file content which responsible for comments is following:

context -- \n brown
    spellcheck

context /\* \*/ brown
    spellcheck

Example of one line comments is here:

-- This line starts with comment
this is code -- This is another comment, which ends with '\n'
this is another code -- This is another comment, which ends with '--' -- this is another code after comment

How to highlight one line comment that may end with "\n" or with "--"?

sorin
  • 161,544
  • 178
  • 535
  • 806
Umid
  • 81
  • 1
  • 6
  • my similar solution, but on objective-c, i think it helpful http://stackoverflow.com/questions/8030552/whats-a-good-regular-expression-for-comment-syntax-highlighting – Volodymyr B. Nov 08 '11 at 19:01

1 Answers1

-1

This question is probably more suited to superuser, however:

Based on the man page, I would try:

context linestart -- \n brown
    spellcheck

context linestart -- -- brown
    spellcheck
Caspar
  • 7,039
  • 4
  • 29
  • 41
  • On mc internal editor's syntax file can't contain more than one 'context' tag which starts with the same symbols. Therefore I should use regular expression in this situation. I've already tried these syntax: context -- \[\n|--\] brown spellcheck Anybody know what reg-exp should I use? – Umid Jun 24 '11 at 07:56
  • Thank you for response Casper. But lines may not start with comments. – Umid Jun 27 '11 at 04:33
  • @user694192 regarding your regexp question: "The wildcard may be used within context delimiters as well, but you cannot have a wildcard as the last or first character." (man mcedit) The `[]` character class apparently is also considered wildcard, which makes your problem impossible to solve in current MCEdit. – manatwork Sep 05 '11 at 14:35