The three rules of Ruby Q.:
Please do not post any solutions or spoiler discussion for this
quiz until 48 hours have elapsed from the time this message was
Support Ruby Q. by submitting ideas and responses
as often as you can!
Suggestion: A [QUIZ] in the subject of emails about the problem
helps everyone on Ruby T. follow the discussion. Please reply to
the original quiz message, if you can.
RSS Feed: http://rubyquiz.strd6.com/quizzes.rss
Syntax Highlighting (# 218)
Namo namah Rubyists,
This week’s quiz is to write a syntax highlighter. Your program or
method will take as input unadorned Ruby code and return marked-up
code. Different syntactical elements of the code should have different
styles. As an additional challenge you may wish to indicate syntax
errors at the point in which they occur in the code. You may choose
any output style that you like. If you are unsure of what to use to
colorize output, then check out Term::ANSIColor1.