PSP.BraceConverter | index /root/instaladores_rar/Webware-andes/PSP/BraceConverter.py |
BraceConverter.py
Contributed 2000-09-04 by Dave Wallace (dwallace@delanet.com)
Converts Brace-blocked Python into normal indented Python.
Brace-blocked Python is non-indentation aware and blocks are delimited by ':{' and '}' pairs.
Thus:
for x in range(10) :{
if x%2 :{ print x } else :{ print z }
}
Becomes (roughly, barring some spurious newlines):
for x in range(10) :
if x%2 :
print x
else :
print z
This implementation is fed a line at a time via parseLine(), outputs to
a PSPServletWriter, and tracks the current quotation and block levels internally.
Modules | ||||||
|
Classes | ||||||||
|