Skip to content

Commit a2e51a6

Browse files
committed
[php mode] Allow interpolation in double-quoted heredoc strings
Issue codemirror#3421
1 parent e36dff2 commit a2e51a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mode/php/php.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@
107107
"<": function(stream, state) {
108108
var before;
109109
if (before = stream.match(/<<\s*/)) {
110-
var nowDoc = stream.eat(/['"]/);
110+
var quoted = stream.eat(/['"]/);
111111
stream.eatWhile(/[\w\.]/);
112-
var delim = stream.current().slice(before[0].length + (nowDoc ? 2 : 1));
113-
if (nowDoc) stream.eat(nowDoc);
112+
var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1));
113+
if (quoted) stream.eat(quoted);
114114
if (delim) {
115115
(state.tokStack || (state.tokStack = [])).push(delim, 0);
116-
state.tokenize = phpString(delim, nowDoc ? false : true);
116+
state.tokenize = phpString(delim, quoted != "'");
117117
return "string";
118118
}
119119
}

0 commit comments

Comments
 (0)