Re: Gelex problem
Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]> Fri, 11 Oct 2013 23:48:10 +0200
| Newsgroups | gmane.comp.lang.eiffel.gobo.general |
|---|---|
| Message-ID | <[email protected]> |
On 10/11/2013 8:56 PM, Thomas Beale wrote:
> On 11/10/2013 15:36, Eric Bezault wrote:
>> Hi Thomas,
>>
>> Can you try to write ^[^ \t] at the beginning of the line
>> (no indentation)? I suspect that the tab used to indent this
>> line is considered as part of the regexp.
>>
>
> I just tried that:
>
> <IN_CADL_SECTION>{
> ^[ \t]+[^\n]*\n {
> io.put_string ("##### matched whitespace non-lf* lf #########%N")
> io.put_string ("%T##### " + text + " #########%N")
> in_buffer.append_string(text)
> in_lineno := in_lineno + 1
> }
>
> \n+ in_lineno := in_lineno + text_count
>
> ^[^ \t] { -- non-white space at start
> io.put_string ("##### matched non-whitespace at start
> #########%N")
> io.put_string ("%T##### " + text.item(1).code.out + "
> #########%N")
> unread_character(text.item(1))
> last_token := V_CADL_TEXT
> create str_.make (in_buffer.count)
> str_.append_string (in_buffer)
> in_buffer.wipe_out
> last_string_value := str_
> set_start_condition(INITIAL)
> }
> }
>
>
> The result is exactly the same as before - the following gets printed out:
>
> ##### matched non-whitespace at start #########
> ##### 32 #########
>
> I'm running out of ideas!
I wrote a simple example based on the code above, and it worked
as expected. I got the following:
##### matched whitespace non-lf* lf #########
##### toto
#########
##### matched non-whitespace at start #########
##### 100 #########
--
Eric Bezault
mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]
http://www.gobosoft.com