Want to help DMD bugfixing? Write a simple utility.

spir denis.spir at gmail.com
Fri Mar 25 05:19:53 PDT 2011


On 03/25/2011 12:08 PM, Regan Heath wrote:
> On Wed, 23 Mar 2011 21:16:02 -0000, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
>> There are tasks for which you need to be able to lex and parse D code. To
>> 100% correctly remove unit tests would be one such task.
>
> Is that last bit true? You definitely need to be able to lex it, but instead of
> actually parsing it you just count { and } and remove 'unittest' plus { plus }
> plus everything in between right?

At first sight, you're both wrong: you'd need to count { } levels. Also, I 
think true lexing is not really needed: you'd only need to put apart strings 
and comments that could hold non-code { & }.
(But these are only very superficial notes.)

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d-learn mailing list