# Another transition thing
# This is exactly like css2html.txt, with macro replacement

family csl

state IN_CSL_DEFAULT:
'</' : paint(upto, CSL_DEFAULT) => IN_CSL2H_1

state IN_CSL_COMMENT_LINE_1:
'</' : paint(upto, CSL_COMMENT) => IN_CSL2H_1b # for comments

# Check to see if we're actually ending a script tag, or just
# typing some random characters

state IN_CSL2H_1:
/(?:xbl:)?(?:body|handler|getter|setter|field|constructor|destructor)\b/i: paint(upto, M_ETAGO), paint(include, M_TAGNAME), => IN_CSL2H_2
/./ : paint(upto, CSL_OPERATOR), redo, => IN_CSL_DEFAULT
/\z/ : paint(upto, CSL_OPERATOR)

state IN_CSL2H_1b:
/(?:xbl:)?(?:body|handler|getter|setter|field|constructor|destructor)\b/i: paint(upto, M_ETAGO), paint(include, M_TAGNAME), => IN_CSL2H_2
/[\r\n]/ : paint(upto, CSL_COMMENT), => IN_CSL_DEFAULT
/./ : => IN_CSL_COMMENT_LINE_1
/\z/ : paint(upto, CSL_COMMENT)

# This state here is to check for the closing '>'.
# Whether it's there or not we're going back to HTML

state IN_CSL2H_2:
/[$WS]/ : #stay
'>' : paint(upto, M_TAGSPACE), paint(include, M_ETAGC) => IN_M_DEFAULT
/./ : paint(upto, M_TAGSPACE), redo => IN_M_DEFAULT
/\z/ : paint(upto, M_TAGSPACE)

