Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for heredocs used in functions. #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

waratuman
Copy link

Previously using a heredoc in a function would result in the rest of the
line after a heredoc assumed as being part of the string and would be
makred as part of the heredoc, but the heredoc doesn't start until the next
line.

eg. exec_sql(<<SQL, 1, 'book')
SELECT * FROM products WHERE id = ? OR name = ?;
SQL

This commit marks the heredoc declarations and the heredoc as part of
the heredoc, but leaves the rest of the line marked as ruby.

Also adding support heredocs with backticks.

Previously using a heredoc in a function would result in the rest of the
line after a heredoc assumed as being part of the string and would be
makred as part of the heredoc, but the heredoc doesn't start until the next
line.

  eg.  exec_sql(<<SQL, 1, 'book')
    SELECT * FROM products WHERE id = ? OR name = ?;
  SQL

This commit marks the heredoc declarations and the heredoc as part of
the heredoc, but leaves the rest of the line marked as ruby.

Also adding support heredocs with backticks.
Adding support for here docs that use the double chevrons '<<' in
argument lists.

eg. puts "hi", <<DOC
hello world
DOC
@waratuman
Copy link
Author

Also addresses #73

* upstream/master:
  Use updated documentation command on 10.10
  Add keyword `fail` to grammar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant