crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Heredoc identifier can accept any starting identifier value

Open devnote-dev opened this issue 5 months ago • 0 comments
trafficstars

Typically, all identifiers must start with an ASCII letter or underscore and proceeding alphanumeric character, however, numeric and underscore-only identifiers are accepted for heredocs:

p <<-123
  4567
      654
  123
# => "4567\n    654"

p <<-_
  foo
  bar
  _
# => "foo\nbar"

devnote-dev avatar May 29 '25 23:05 devnote-dev