By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,400 Members | 903 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,400 IT Pros & Developers. It's quick & easy.

ignore cstylecomment issues

P: n/a
from pyparsing import Word, printables,ZeroOrMore,cStyleComment
expr = ZeroOrMore(Word(printables))
expr.ignore(cStyleComment)
for line in expr.parseString('#include <iostream>\n\nint
main()\n{/*interesintg\ncomment*/\nstd::cout << "hello world";\n}'):
print line

outputs

#include
<iostream>
int
main()
{/*interesintg
comment*/
std::cout
<<
"hello
world";
}

if i put a space between { and /* then it works properly

any help plz

Oct 19 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.