raiseexceptions.SyntaxException("Keyword '%s' not a legal ternary for keyword '%s'"%(node.keyword,self.control_line[-1].keyword),self.matched_lineno,self.matched_charpos)
defparse(self):
length=len(self.text)
while (True):
...
...
@@ -134,7 +143,6 @@ class Lexer(object):
\Z # end of string
)""",re.X|re.S)
ifmatch:
text=match.group(1)
self.append_node(parsetree.Text,text)
...
...
@@ -175,6 +183,12 @@ class Lexer(object):
raiseexceptions.SyntaxException("Invalid control line: '%s'"%text,self.matched_lineno,self.matched_charpos)
(isend,keyword)=m2.group(1,2)
isend=(isendisnotNone)
ifisend:
ifnotlen(self.control_line):
raiseexceptions.SyntaxException("No starting keyword '%s' for '%s'"%(keyword,text),self.matched_lineno,self.matched_charpos)
elifself.control_line[-1].keyword!=keyword:
raiseexceptions.SyntaxException("Keyword '%s' doesn't match keyword '%s'"%(text,self.control_line[-1].keyword),self.matched_lineno,self.matched_charpos)