Tag Info

New answers tagged

2

It can be done using the Python ply.lex module to write a simple tokenizer: import ply.lex, argparse, io #Usage # python stripcomments.py input.tex > output.tex # python stripcomments.py input.tex -e encoding > output.tex def strip_comments(source): tokens = ( 'PERCENT', 'BEGINCOMMENT', 'ENDCOMMENT', 'BACKSLASH', ...



Top 50 recent answers are included