All pastes #279868 Raw Edit

Untitled

public text v1 · immutable
·published 2006-12-15 11:37 UTC
rendered paste body
# lexing
while token_type is not eof
   if(token_type)=begincomment
       inbegincomment = true

   if(token_type=endcomment
       if incomment
          inbegincomment = false

   if incomment
       style = commentstyle
       else 
       style = stylemap.getstyle

  
    drawlines with the style

# lexing is done

if still in begincomment
   lexer the rest of the document until the ending comment is found applying the comment style

if was in endcomment with no matching begincomment
   lexer the document until the beginning until a begincomment is found applying an error style or a comment style