Re: [Vala] Vala highlightening for LaTeX lstlisting



Frederik Sdun wrote:
Ah, CTAN. that's the place for submitting it. My brain always fell back
to CPAN.
Anyone misses a keyword?
Is it possible to colorize the annotations instead of using CCode,DBus
and Test?

Hi Frederik,

CCode,DBus,Test,cname,cheader_filename,type_id,
marshaller_type_name,get_value_function,set_value_function,
default_value,IntegerType,rank,type_signature,SimpleType,
cprefix,has_type_id,has_target,unref_function,free_function,Compact,
ref_function,destroy_function,PrintFormat,Diagnostics,array_length_type,
has_array_length,is_null_terminated,ReturnsModifiedPointer,dup_function

All of these are attributes / attribute parameters. I agree with you, I
don't think that it's a good idea to treat them as keywords. There are
many more and they are changing more frequently than keywords. Attributes
should be recognized as attributes in general. Actually the C# syntax
should already do that, but obviously it doesn't since you're asking.
Unfortunately I'm not familiar enough with the LaTeX syntax in order to
help you.

Basic Types:

size_t,int8,int16,int32,int64,uint8,uint16,uint32,uint64,float,double,time_t,
unichar

'ssize_t' and 'uchar' are missing. 'float' and 'double' should be inherited
from the C# syntax.

Keywords:

get,set,delegate,errordomain,weak,owned,unowned,value,var,async

'get', 'set', 'delegate', 'value', 'var' should already be defined in the C#
syntax if it's up-to-date.

Vala's 'signal', 'construct', 'dynamic', 'requires', 'ensures' are missing.

connect

I don't think this should be coloured as a keyword. Of course, it's a special
Vala thing, but Vala wants it to look like a method. Otherwise you would have
to colour '.begin()', '.end()', '.callback' for async methods and '.length'
for arrays as well. And '.disconnect()', of course.

FILE,LINE,METHOD

Where are these from? I can't find them anywhere. Only 'FILE' which is a type
of 'posix.vapi'. But I don't think it should be treated in a special way.


I'm not sure if it's the best thing to inherit from the C# syntax, because
many C# keywords / basic types are not available in Vala: byte, sbyte, decimal,
operator, event, object, unsafe, where, explicit, implicit, goto, checked,
unchecked, fixed, stackallock, readonly, params, partial, sealed,
add, remove and all the LINQ keywords: from, group, into, join, let, orderby,
select.

This list of Vala keywords is complete (I have checked it with
'vala/valascanner.vala'):
http://live.gnome.org/Vala/Syntax

'params' and 'volatile' are reserved but not used yet, AFAIK.

Here's a list of all C# 3.0 keywords for comparison:
http://msdn.microsoft.com/en-us/library/x53a06bb.aspx


Best regards,

Frederik



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