Re: [Vala] genie # comments



Maybe you could improve the comment handling code to do sth for this:
http://mail.gnome.org/archives/vala-list/2009-April/msg00025.html

This proposal says that the single line style comment, which describes
your next few lines of code, could be used for debugging. This is very
similar to the document information added to multi line comments,
which can be extracted by a doc creator tool.

When sby wants to compile a more debug friendly version, he/she could
add a compiler parameter, and the properly formatted comments in the
src code would be compiled as logger calls. This way the logger calls
and other debugging aimed code could be very easily discerned in the
src, so it improves code readability.
Lets imagine an ordinary scenario: one have a good idea and writes
some src code abruptly to see how it works in practice, with a few
comment lines. When it is compiled to binary, and sth doesn't work,
one could put some stdout.printf() lines without method, or this
feature could be turned on, and the compiled (but buggy) program could
show how far can it run, and after which code fragment drops a
segfault (for example).

The special comment lines should be marked somehow, since those could
contain some variable references for ex., which the compiler should
convert to its actual value during run.

I thought this idea would be very popular, and it worths a 2nd shot.
I'm not familiar with the Vala compiler intrenals. Sby who has the
knowledge could write this cool feature.

On Tue, Jul 14, 2009 at 11:44 AM, pancake<pancake youterm com> wrote:
I have written my first patch for the vala compiler... well, to be exact
it is only for the genie syntax parser.

The attached patch adds support for python-like comments for the Genie
compiler. This way it is possible to do things like that:

$ cat vala/test.gs
# Here is another comment
init  # in the middle of foo
      # This is a comment
      print "Hello World"

Can somebody review the patch? I think that '#'-like comments looks better
for a syntax like Genie, than using // and /*/*/. My patch just adds support
for this new kind of comments (does not removes the support for // or /*)

--pancake

_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list





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