From: Florian Gross Date: 2004-10-20T19:49:18+09:00 Subject: Re: documentation as source trans. (T. Onoma) wrote: > On Tuesday 19 October 2004 04:44 pm, Florian Gross wrote: > | trans. (T. Onoma) wrote: > | > But perhaps Mauricio was intending to get rid of the indentation too? In > | > fact I was wondering about that. How does it know code from comment? What > | > about something like this: > | > > | > # Presents a challenge > | > # ex-- > | > # > | > # challenge option > | > # > | > # There are three options: > | > # > | > # jump > | > # sit > | > # stand > | > # > | > def challenge( option ) > | > # ... > | > end > | > | Currently it doesn't. Everything that is indented is assumed to be code. > | If you can think of an algorithm that works better than I would be > | pleased to know about it. > > Well I'm not sure what your doing presently. You could require an indented > remark. > > But I suppose a better option would be more intelligent. What about first > syntax parsing the indented material. If no syntax errors, then good chance > it's Ruby code. But even your example from above would pass the Syntax Parsing step. And I think that one might even get false negatives, not only false positives.