[Gambas-devel] pcre progress

Benoit Minisini gambas at ...1...
Sun Jan 9 18:37:31 CET 2005


On Sunday 09 January 2005 00:57, Rob wrote:
> Here's where I'm at on the new pcre component.... I've been
> bashing my head against it all day (since we're snowed in :) )
> and I appear to have the two virtual classes set up right, and
> all the constants in there that Benoit asked for.  And the main
> class's properties work fine, so you can initialize it and get
> the matching part of the string, but
>
> (a) trying to access the virtual classes through the Submatch
> property results in "Not an object"
>

SubMatch is a method!? It should br a property declared with 
GB_PROPERTY_SELF(), that returns the RegExp object temporarily casted into 
".SubMatches". Name it 'SubMatches' instead of 'SubMatch'

I patch your code, and test your test project.

> and
>
> (b) merely typing "r = new Regexp(" in the IDE causes the IDE to
> crash with signal 11, which I assume is a segv.
>

No crash there.

> If any other component developers can point out my rookie
> mistake(s) I'd greatly appreciate it.
>
> Rob
>
>

Ha! Memory leak in the component... Your test project forgot to free 3 
allocations...

I suggest:

- Renaming SubMatch(es) to simply Match(es) as there is no ambiguity. 

- Remove the 'Err' prefix in constant error codes.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regexp.c
Type: text/x-csrc
Size: 6888 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20050109/a39248e8/attachment.c>


More information about the Devel mailing list