POV-Ray : Newsgroups : povray.pov4.discussion.general : Suggest v4.0 experimental features : Re: Suggest v4.0 experimental features Server Time
1 Apr 2025 16:36:56 EDT (-0400)
  Re: Suggest v4.0 experimental features  
From: ingo
Date: 19 Mar 2025 15:20:00
Message: <web.67db189c2ef514c117bac71e8ffb8ce3@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> #read by whole line - [...]

// is the simple one, once you have detected it just skip to end of line.

/* is trickier, you have to scan characters until you find */ and then POV-Ray
supports nested multiline comments. So if you find a second /* in a comment you
either have to start a counter or use recursion otherwise you'll miss the true
end of the comment.

Lots of parsers are clever, they can skip parts of words when they are sure that
there is no other option than that specific keyword even if they are only half
way parsing that word. But in the end you still have to visit a lot of
characters.

My POV-Ray HTML highlighter (https://ingoogni.nl/download/) parses a POV-Ray
file using regular expressions, not the most elegant way to do it. It properly
handles the nested comments.

ingo


Post a reply to this message

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