On Thu, May 31, 2018 at 1:39 PM, vitalije <[email protected]> wrote:
Are you sure it is still correct import?
>
There was indeed a bug involving verbatim lines. The fix further
simplifies the code. The start of the main loop is now:
for i, line in flines[start:]:
# These three sections must be first.
<< handle verbatim lines >>
<< unindent the line if necessary >>
<< short-circuit later tests >>
where << short-circuit later tests >> is:
# This is valid because all following sections are either:
# 1. guarded by 'if in_doc' or
# 2. guarded by a pattern that matches delim_st + '@'
if not in_doc and not line.strip().startswith(delim_st+'@'):
body.append(line)
continue
I have added the following comment to the start of << handle start of @doc
parts >>:
if not in_doc:
# This guard ensures that the short-circuit tests are valid.
m = doc_pat.match(line)
if m:
This seems like a proof of correctness. Do you agree?
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.