We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,973 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

mcedit syntax highlight question

Hi all.
I need to highlight comments on mcedit.
1) comments start with "--"
2) comments may may end with "\n" or with "--"

how to do it in mcedit syntax file?

These lines are my syntax file content which responsible to highlight comments

context -- \n brown # here I have trouble, comments may end with "--" too
spellcheck
context /\* \*/ brown
spellcheck

Please help!

2
Contributors
6
Replies
2 Weeks
Discussion Span
1 Year Ago
Last Updated
7
Views
_neo_
Junior Poster in Training
65 posts since Aug 2010
Reputation Points: 26
Solved Threads: 3
Skill Endorsements: 0

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 this syntax:

context -- \[\n|--\] brown
    spellcheck

Anybody know what reg-exp should I use?

_neo_
Junior Poster in Training
65 posts since Aug 2010
Reputation Points: 26
Solved Threads: 3
Skill Endorsements: 0

Help, please...
I have not solved my problem yet...

_neo_
Junior Poster in Training
65 posts since Aug 2010
Reputation Points: 26
Solved Threads: 3
Skill Endorsements: 0

Hi _neo_!

Just to be sure, can you tell us what language you're working with? There are a couple of ways this might be accomplished, but I wanted to be sure I'm testing with the correct base syntax file first.

Thanks!
-G

Gromit
Posting Whiz in Training
214 posts since Sep 2008
Reputation Points: 47
Solved Threads: 33
Skill Endorsements: 0

Hi Gromit.
I'm trying do syntax highlighting for ASN.1 syntax.
I've attached what I have now.
Please, help me.
Thank you in advance.

Attachments asn.syntax_.txt (4.88KB)
_neo_
Junior Poster in Training
65 posts since Aug 2010
Reputation Points: 26
Solved Threads: 3
Skill Endorsements: 0

Hmm... I wonder if you can do it like it's done in the lua.syntax file?

There's a 'keyword' line under 'context default' that looks like this: keyword -- brown There is also a separate section similar to the comment line that you have that looks like this:

context exclusive -- \n brown
    spellcheck

I hope this helps!
-Jeo

Gromit
Posting Whiz in Training
214 posts since Sep 2008
Reputation Points: 47
Solved Threads: 33
Skill Endorsements: 0

Hi Gromit. Thank you for response.
I've tried do like lua's syntax file, but it doesn't solve my problem.

Does anybody have other ideas?

Here is example of one line comments:
code --start of one line comment, which ends with carriage-return
code --start of one line comment, which ends with '--' symbols -- continue code

_neo_
Junior Poster in Training
65 posts since Aug 2010
Reputation Points: 26
Solved Threads: 3
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0794 seconds using 2.67MB