octave-maintainers
[Top][All Lists]
Advanced

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

Re: mercurial in OS 10.4.11 (was imread/imwrite)


From: Jaroslav Hajek
Subject: Re: mercurial in OS 10.4.11 (was imread/imwrite)
Date: Sat, 21 Jun 2008 07:20:22 +0200

On Sat, Jun 21, 2008 at 12:06 AM, dbateman <address@hidden> wrote:
>
>
>
> Jaroslav Hajek-2 wrote:
>>
>> Okay, so what about the following? It's the "good old way", using only
>> index and substr.
>> This should definitely be POSIX compatible...
>>
>
> snip
>
>
>
>> @@ -490,7 +497,11 @@
>>  /BEGIN_PROPERTIES\(.*\)/ {
>>    gather = 1;
>>    idx = 0;
>> -  class_name = gensub (/^.*BEGIN_PROPERTIES\((.*)\)/, "\\1", "g");
>> +  str = $0;
>> +  k = index (str, "BEGIN_PROPERTIES(");
>> +  str = substr (str, k + 17);
>> +  l = index (str, ")");
>> +  class_name = substr (str, 1, l-1);
>>    next;
>>  }
>>
>
> Doesn't the "g" in the gensub command mean "global" so I expect you also
> need a loop for the above.
>

It does, but there are never multiple BEGIN_PROPERTIES on the same
line in graphics.h.in and I think there should never be. Also, the GNU
Awk manual says that sub, gsub and gensub search for "the leftmost,
longest" match, so the original gensub would not work either for
multiple decls on the same line.
A similar case is the one with {} matching - there should always be at
most one default value.


> D.
>
> --
> View this message in context: 
> http://www.nabble.com/imread-imwrite-tp18018475p18038201.html
> Sent from the Octave - Maintainers mailing list archive at Nabble.com.
>
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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