Only Syntax

Journal of my investigation into the development of a new programming language

Thursday, January 13, 2005

 

Nest Shading



I've been playing with C# and Python lately, working my way toward an editor for my language, and working on some of the language ideas as well. The picture below is a screenshot from my C# app, holding Python code. I like Python's indentation-based blocks, and plan to use the same approach in my own language.

I was focussing on the ability to highlight code that failed tests, as I did in my "zero button testing" prototypes, and realized that I wanted to have both syntax coloring (keywords in blue, method names in green, etc.) and correctness coloring, at the same time. In the ZBT prototypes, I used text forecolor to indicate correctness; for the new app, I want to reserve forecolor for syntax and use background shading to indicate correctness.

As I explored the ways to do background shading, it occurred to me that in addition to the very limited red-for-error, yellow-for-untested palette I was planning, it would also be possible to do a more nuanced coloring that showed nesting level. I like it; it makes it easy to focus attention on one particular block. Note that in addition to the line-by-line coloring, I'm also splitting individual lines at the colon (and, for my own language, at the question mark); this emphasizes the columnar nature of some sections of code; I think it might work well with SQL, which I've long preferred in a nice columnar format.

Comments: Post a Comment

<< Home

Archives

03/30/2003 - 04/06/2003   04/06/2003 - 04/13/2003   10/12/2003 - 10/19/2003   01/09/2005 - 01/16/2005   01/16/2005 - 01/23/2005  

This page is powered by Blogger. Isn't yours?