Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
feat(ruby.cson) support quoted heredoc literals #212
Thanks for maintaining this project and considering my PR!
Description of the Change
Ruby supports quoted heredocs:
string1 = <<-STR Hello World STR string2 = <<-"STR" Hello World STR string3 = <<-'STR' Hello World STR shell_block = <<-`COMMAND` ls ~ pwd COMMAND
But they aren't captured by the current grammar. This change adds quotes to the heredoc regexps so that they'll be properly tokenized.
No alternate deisgns were considered.
We use single-quoted heredocs to assert that interpolation is not possible. This is a security check: interpolation can lead to various injection bugs.
Embedded code is not highlighted right now:
But after this change, it will be highlighted!
Added complexity to the heredoc regexp.
I didn't find any.