markwatkinson / luminous

Accurate and powerful syntax highlighting library
http://luminous.asgaard.co.uk
GNU Lesser General Public License v2.1
51 stars 5 forks source link

Ruby heredoc #1

Closed markwatkinson closed 13 years ago

markwatkinson commented 13 years ago

Ruby's heredoc allows unusual constructs like the following:

# a comment should look like this
some_function("arg1", arg2 + 2, <<ARG3, arg4 + 4, "arg5") # not like this
arg3
ARG3

which renders:

Currently the Ruby scanner goes into heredoc mode as soon as it sees the '<<DELIMITER' and the rest of the line is immune to highlighting (aside from other heredoc declarations). The Ruby scanner's main loop structure is pretty ugly and needs refactoring anyway, but it should also be possible to delay heredoc mode until EOL.