I've found a brute-force solution. In the preprocessing phase I simply strip out the comments (things inside comments won't appear in the result) and replace curly brackets with these symbols: #::OPEN::# and #::CLOSE::#. After parsing I convert them back. In fact I can disclude commented lines from the analyzis as I only have to cope with production code.
Claudio Grondi írta: > Károly Kiripolszky wrote: > > You're right, thank you for the comment! I will look after how to > > avoid this. > And after you have resolved this 'small' ;-) detail you will probably > notice, that some full functional and in wide use being parser have > still trouble with this ... > > Claudio > > > > Marc 'BlackJack' Rintsch írta: > >> In <[EMAIL PROTECTED]>, > >> karoly.kiripolszky wrote: > >> > >>> and the great thing is that the algorithm can be used with any > >>> language that structures the code with brackets, like PHP and many > >>> others. > >> But it fails if brackets appear in comments or literal strings. > >> > >> Ciao, > >> Marc 'BlackJack' Rintsch > > -- http://mail.python.org/mailman/listinfo/python-list