Re: trap works funny
Ger Hobbelt <[email protected]>
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
Very interesting test case. I'm quite sure you've just hit a language bug, i.e. a bug in the crm114 script parser/interpreter, regarding fall-through when matching traps. (Or it's the other bug regarding trap/failure jump destination calculation, where nested faults (fault within fault) goes ape. This is definitely one to add to the test set, at least for GerH builds. (And nope, I'm not sure my code will 'survive' this scenario either. I've completely overlooked the scenario where you can have multiple traps within the same brace-scope, which, from the language grammar definition (koff koff) is legal. Besides, its intuitive, especially since this idiom is the common way how other languages with exception-handling capability offer comparable language constructs. (try/catch, ...) ) To be tested... On Thu, Mar 12, 2009 at 10:41 AM, Thomas Michael Hagen <[email protected]> wrote: > this is an (edited for clarity) excerpt from a program i running. i > expected it to liaf to the next file on both traps, and it does on the > first one. however, the program simply stops without any explanation > on the last trap. > > { > match <fromend> (:: :filename:) [:files:] /(^.*?\.dag)\n/ > output /:*:filename:\n/ > call /:read-file:/ [:*:filename:] > liaf > } > > :read-file: (:name:) > { > { > input (:ffile:) [:*:name:] > trap /unable to read-open the file/ > output /Couldn't read file! Trying next file.\n/ > return > > trap /program has overflowed/ #the file is too big for the machine's memory > output /File too big!\n/ > return > } > #doing stuff here if the file exists and is not too big > } > > > this is the output of running it when 'files' is a list that begins > with a nonexistent file, and the second one is too huge: > > nonexistant-file.dag > Couldn't read file! Trying next file. > /prosjekt/aviskorpus/ap/dag/2007/20071120.dag > > note the missing 'File too big' output > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Crm114-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crm114-general > > -- Met vriendelijke groeten / Best regards, Ger Hobbelt -------------------------------------------------- web: http://www.hobbelt.com/ http://www.hebbut.net/ mail: [email protected] mobile: +31-6-11 120 978 -------------------------------------------------- ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com