beaver-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Beaver-devel] New sy/hi with pcre; a second preview


From: Michael Terry
Subject: Re: [Beaver-devel] New sy/hi with pcre; a second preview
Date: Mon, 07 Apr 2003 19:06:03 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030322

Leslie Polzer wrote:
On Mon, 07 Apr 2003 13:33:33 -0400
Michael Terry <address@hidden> wrote:


Disclaimer: I haven't really spent some time looking at the code. I will try to later. But here are some initial comments.

That's alright; I guessed you are quite busy at the moment.

Well, I just beat the new Zelda, so maybe I'll have a bit more time now.  ;)


Leslie Polzer wrote:

NB: colors in syntax files are in range 0-255 instead of GdkColor 0-65535.

Any particular reason?

Not really. I thought Gdk used this range and I'm personally used to it.
When I realized it was different I said to myself that we don't need such a
fine-grained range anyway and left it that way. We may change that of course.

It might be wise to change it. I imagine it would be nice to allow users to change the colors.

Actually, come to think of it -- this was one of my beefs with the wordfile format that we are continuing to perpetuate. There is no easy way to allow the user to change the colors used for things, unless there is some standard with respect to which color means what.

What I'm trying to say is that some wordfiles would have the fifth color be for operators, and the first color for language keywords, second for library calls, third for preprocessor stuff, etc.

However, there was no standard, so the best a GUI could ask the user was, "What do you want the Nth color to be?," without any hint as to what that color is.

Plus, it seems odd that we are putting both the syntactic information about a language right there with the color a GUI will use to display it -- two pieces of information that are tenously connected. It seems more widely useful to match syntax with semantics.

I propose we come up with categories of keywords that we label lines with in the syntax file and in the GUI, we can say, "What color do you want operators to be?"

So...  a quick stab at categories:
operators
preprocessor directives
language keywords
system library keywords
"derived" keywords -- things like GtkWidget
comments
strings
characters

What else?


I'd especially appreciate feedback regarding the syntax file format and
the method I use to read the syntax files (fscanf()).

One suggestion I have is to use the glib-provided |g_file_get_contents|,

You're a walking G* reference.

I do like the g* libraries.  :)


which does nice error checking and gives you a big allocated buffer of the file. I would imagine that parsing a string buffer would be less error-prone that doing it all on the file as it comes in.

Why?

I'm not sure, thinking about it. :) Wouldn't it be easier, though? I mean, you can go back and forth at will. Wereas if you want to do that with scanf, you would end up saving the whole buffer anyway, doing what this call would do. Despite how it sounds, I'm not married to the idea though. ;)


-mt

Attachment: pgpehn2wV7iYu.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]