On 10 March 2010 00:48, Søren Hauberg <[email protected]> wrote:
> tir, 09 03 2010 kl. 22:45 +0000, skrev Carnë Draug:
>> *On continuation lines
>> ... is also identified as a continuation line character
>> continuation lines characters are ignored if they are between single
>> quotes only
>
> It is good that '...' is treated as a continuation, but why aren't they
> ignored when between double quotes?
If I got it right, it seems that I can't use them with single quotes.
# this works
a = "this string should continue ...
here"
# this does not work
a = 'this string never gets ...
here'
>> *On comments
>> comments can be made after the continuation line characters
>> added shebang line (it's no longer just a comment line)
>
> Great. Looking at the file I see the following oddities with respect to
> comments:
>
> <metadata>
> <property
> name="mimetypes">text/x-octave;text/x-matlab</property>
> <property name="globs">*.m</property>
> <property name="line-comment-start">%</property>
> <property name="block-comment-start">^%{$</property>
> <property name="block-comment-end">^%}$</property>
> </metadata>
>
> This only contains Matlab-style comments. Shouldn't it also include
> Octave-style comments, i.e. "#" instead of "%"?
>
> Also, it would be great if Octave-style block comments could be
> supported.
This block has nothing to do with the syntax highlight. I believe it's
where the text editor comes to get info on how to comment code
automatically.
>> *On functions
>> added all functions (I hope).
>
> Do we really want to do this? It seems like a very hard maintenance task
> to keep this up to date.
It takes less than 5min I think. And functions are something that ones
uses a lot so I think it's nice to have them highlighted, even if it's
only so one knows that he made no typo. Specially because there's
already no highlight for the variable names (like in perl where is
easy to identify them). If we don't want all of them here, maybe just
some of the more used but a larger list than the old one which had
only 65 of them.
>> and "pkg" (mapped it to preprocessor).
>
> Why does 'pkg' get a special treatment? Why not just treat it like a
> function?
Like I mentioned, I took the perl lang file as an example (because
it's the only language that I know). In perl, there's the "use" and
require" functions that loads specified modules, functions and checks
for the Perl version being used. So I did the same with pkg here. Is
there any other octave function that behaves similarly?
>> *On metadata
>> added block comment "start" and "end" to the list (can someone test
>> this please? I don't know any editor that uses this)
>
> I don't know what this means?
Explained above what this metadata block does. However, I don't have a
text editor that tries to insert these block comments automatically so
I don't if it works correctly and identifies regexp or if it will
literally place a ^%{$ at the start of the first line that the user
wants to comment.
>> *On operators
>> there's syntax for operators now. I tried to be careful with the
>> transpose operator. Should map all of them
>> what's the thing with - and +? When do they define the signal instead
>> of being operators? Should they be considered numbers in those
>> situations?
>
> I don't understand the question. Could you provide an example?
b = {2 + 3} # plus sign is highlighted as operator
b = {2 +3} # plus sign should be highlighted as number?
b = 2 +3 # plus sign is highlighted as operator which is correct.
But if I had set up tp recognize the line before as number JUST by
checking if there's no space between it and the next number, it would
incorrectly be highlighted as number. If someone can tell me exactly
when + and - is what, I could try to write a regexp for that.
>> *On strings
>> added a printf regexp that should identify the formatting
>
> Cool! Could this be extended to also cover 'sprintf', 'fprintf', 'error'
> and 'warning' ?
If they have the same syntax as printf, it's already working.
Actually, anything between double quotes that tries that get that
highlight. Should I change that? Or should I keep so it's possible to
store a format in a variable like this
format = "now, be should be %g\n"
fancy_var = 5
printf(format, fancy_var)
If they are not exactly the same, what are the differences?
>> * some reserved keywords, like NaN are also functions. Should I refine
>> the regexp to see if they are followed by parenthesis and are
>> therefore functions instead of a constant
>
> That sounds too complex too me (without really having any benefit)
Isn't the whole point of this to have the code highlighted to
distinguish stuff like constants from functions for example? That's
the benefit.
>> * should I list all the pkg options instead of just highlight
>> everything after pkg?
>
> I don't understand the question.
Like I mentioned before, I used Perl as example. They have a list of
stuff that can come after the "use" and "require" functions. Not a
list of all modules, only most of pragmas. I just made it to highlight
everything that comes after pkg until the end of the line. I should
probably make a list of only the pkg commands instead. What about the
name of the different packages?
Carnë Draug
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev