POV-Ray : Newsgroups : povray.unofficial.patches : Error handling during parsing : Error handling during parsing Server Time
4 Nov 2024 18:21:36 EST (-0500)
  Error handling during parsing  
From: Peter Popov
Date: 17 Dec 2003 05:07:12
Message: <vu90uv8qe10h1kfnf0ho8ipt3voq1i1p19@4ax.com>
How hard would it be, and would it make any sense, to implement some
sort of error handling for parse-time errors? For example:

sphere {
  0, 1
  pigment {
    image_map {
      #try png "image1.png"
      #else png "image2.png"
      #end
      interpolate 2
      map_type 1
    }
  }
}

I'm not proposing this syntax, of course (yuck), but the idea is more
or less clear. Parsing goes on as normal but if a parsing error is
generated in a specified block, something else can be said to happen
instead of just aborting.

Probably the only thing this is potentially useful for is for file
operations (#include, #fopen, image_map, density_file, bump_map,
texture_map etc.) Things like division by zero, input out of range,
array range check failure etc. can be handled manually with proper
programming, but for file operations there is currently no way. I
guess it would be simpler to implement an #if_exists or similar not so
horrible keyword that can check if a file exists in the Library_path
but a more general error handling mechanism, if implemented properly,
could make things easier even in cases where it is not the only
option.

What do you guys think?


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.