diff --git a/src/parser.mjs b/src/parser.mjs index 8df49870d..60a90f850 100644 --- a/src/parser.mjs +++ b/src/parser.mjs @@ -12,6 +12,7 @@ function parse(text, opts) { // Todo https://github.com/glayzzle/php-parser/issues/170 text = text.replace(/\?>\n<\?/g, "?>\n___PSEUDO_INLINE_PLACEHOLDER___<\?/g, "?>___PSEUDO_INLINE_PLACEHOLDER___ + + + +X + text + +=====================================output===================================== + + + + +X + text + +================================================================================ +`; + +exports[`alternate.php 1`] = ` +====================================options===================================== +parsers: ["php"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; diff --git a/tests/echo-adjacent/adjacent.php b/tests/echo-adjacent/adjacent.php new file mode 100644 index 000000000..68bda1440 --- /dev/null +++ b/tests/echo-adjacent/adjacent.php @@ -0,0 +1,6 @@ + + + + +X + text diff --git a/tests/echo-adjacent/alternate.php b/tests/echo-adjacent/alternate.php new file mode 100644 index 000000000..cf7f89aca --- /dev/null +++ b/tests/echo-adjacent/alternate.php @@ -0,0 +1 @@ + diff --git a/tests/echo-adjacent/jsfmt.spec.mjs b/tests/echo-adjacent/jsfmt.spec.mjs new file mode 100644 index 000000000..8829c872f --- /dev/null +++ b/tests/echo-adjacent/jsfmt.spec.mjs @@ -0,0 +1 @@ +run_spec(import.meta, ["php"]);