Skip to content

Commit

Permalink
Added comment and raise tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Mar 4, 1998
1 parent 0cafce5 commit 9d72d60
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions DT_String.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

from string import *
import DT_Doc, DT_Var, DT_In, DT_If, regex
import DT_Doc, DT_Var, DT_In, DT_If, regex, DT_Raise
Var=DT_Var.Var

from DT_Util import *
from DT_Comment import Comment

class String:
__doc__=DT_Doc.String__doc__
Expand All @@ -29,6 +30,8 @@ def parse_error(self, mess, tag, text, start):
'if': DT_If.If,
'unless': DT_If.Unless,
'else': DT_If.Else,
'comment': Comment,
'raise': DT_Raise.Raise,
}

def SubTemplate(self, name): return String('', __name__=name)
Expand Down Expand Up @@ -161,7 +164,9 @@ def parse_block(self, text, start, result, tagre,
sargs=args
sstart=start
else:
try: result.append(scommand(blocks))
try:
if scommand is not Comment:
result.append(scommand(blocks))
except ParseError, m: self.parse_error(m[0],stag,text,l)

return start
Expand Down

0 comments on commit 9d72d60

Please sign in to comment.