jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Looping and composite conditions


Hi,

I am still working on my po_mode and while trying to improve
the search function for untranslated strings I stumbled upon
something I don't quite understand. The functions look like this:

   static define untranslated ()
   {
      bol_fsearch ("msgstr") and fsearch ("\"") and looking_at ("\"\"")
        and down_1 () and skip_chars (" \t\n") and looking_at ("#");
   }
   
   define find_untranslated ()
   {
      forever
        {
           if (eobp ())
             {
                message ("Not found");
                bob ();
                return;
             }
           if (1 == untranslated ()) break;
        }
      bsearch ("\"");
   }

The format of the text to parse looks like this;   

   #: src/generic/aptcache.cc:1099 src/generic/aptcache.cc:1171
   msgid "The list of sources could not be read."
   msgstr ""
   
   #: src/generic/aptcache.cc:1105 src/generic/aptcache.cc:1178
   msgid "The package lists or status file could not be parsed or
   opened."
   msgstr "Pakkelisterne eller statusfilen kunne hverken fortolkes
   eller åbnes"

The first paragraph of the two above is an untranslated entry
but when executing the function it fails with:

  "S-Lang Error: Stack Underflow: Error while executing find_untranslated"

However if omit the skip whitespace and newline/tabs part and change the 
function "untranslated" to contain   

   bol_fsearch ("msgstr") and fsearch ("\"") and looking_at ("\"\"")
     and down_1 and bolp () and eolp ();

then it works fine. This would work 99% of the time but isn't
quite precise since it's not an error to gettext to have a
blank line below "msgstr" and subsequent translated strings
after that. Is there some way I could get what I want. Perhaps
another form of looping construct?


Thanks,

Morten

     
-- 
"Nothing in life is so exhilarating as to be shot at without result."
                                                (Winston Churchill)

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]