Jasper
Jasper

Reputation: 547

How does syntax coloring work

What is the right way of doing syntax coloring in a grammar? I believe it was like this:

syntax MappingName = @category="Constant" mappingname: Id mapping;

But it doesn't work for me. The file is just black text without parse errors (and it is open in the IMP editor, and I saw it create a parser).

Upvotes: 0

Views: 113

Answers (1)

Davy Landman
Davy Landman

Reputation: 15439

For inspiration, you can always look at the Rascal grammar. Where you can see that your syntax and category name seem correct.

Try what happens if you have no name for the production?

syntax MappingName = @category="Constant" Id mapping;

Upvotes: 1

Related Questions