← Graph

Adjacent String Literal Concatenation

concept 1 connections

Ruby (like Python, C, and C++) concatenates adjacent string literals at parse time, so `'hello' " world"` becomes `'hello world'` without any explicit operator. Works across quote styles and multiple lines, and has been in Ruby since early versions. Implemented in parse.y via the recursive rule `string : string1 | string string1`.

category
pattern
about
Adjacent String Literal Concatenation concept
Opens with the Ruby behavior where adjacent string literals auto-concatenate.

Provenance

Read by
4 extractions