jcubic / gaiman

Gaiman: Text based game engine and programming language
https://gaiman.js.org
GNU General Public License v3.0
138 stars 11 forks source link

Calling methods on literal heredocs #65

Closed jcubic closed 2 years ago

jcubic commented 2 years ago
echo <<<TEXT
this
is
text
TEXT.toUpperCase()
jcubic commented 2 years ago

The methods chain needs to be refactored since:

this works:

let x = ((<<<TEXT
this
is
text
TEXT)).toUpperCase().replace(/this\n/i, "")

and this doesn't

let x = (<<<TEXT
this
is
text
TEXT.toUpperCase()).replace(/this\n/i, "")

Not sure how this should be implemented.