The IDE syntax coloring is fine by me. I use similar syntax coloring for I7 code on my web site (https://eblong.com/zarf/zweb/heliopause/Heliopause-src.html), and I also wrote an Atom colorer which is used on Github. That just distinguishes headers, code, comments, strings, string interpolations, and (for the bonus round) I6 inclusions. That’s all pretty easy.
My dream is to use the compiler’s parser to do semantic coloring, ie:
- Object names (“the lamp”)
- Object descriptions (“all open containers”)
- Action descriptions (“taking a lit thing”, “putting something in the box”)
- Top-level declarations (“The player carries the lamp.”)
- Rule headings (“Before opening a door:”)
- Adjectives in descriptions (“open” in “all open containers”)
This would be helpful in sorting out what’s going on when the compiler’s interpretation is unobvious. I.e., the perennial questions about “Before touching something carried by the player for the first time in the Library”. (Not a real example, sorry; I couldn’t find a real example question in a hurry. But that sort of thing.)
The problem with this idea is that these coloring categories form a nested tree! You could write
Before putting something in the open box: ...
So “box” is an object name; “the open box” is an object description; “open” is an adjective; “putting something in the open box” is an action description; the whole line is a rule header. It’s not at all clear how to represent this for the author without drowning them in colored confetti.
Maybe a pop-up tooltip window showing a nested hierarchy. I mean, that’s terrible, but it’s similar to how the developer console of a web browser works when you dig into the DOM.