| Summary: | Heredoc (here document) without newline breaks syntax coloring | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Christ van Willegen <christ> | ||||||||||
| Component: | PDT | Assignee: | PHP UI <php.ui-inbox> | ||||||||||
| Status: | CLOSED FIXED | QA Contact: | Ilina Stefanova <ilina.s> | ||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | euthanasia_waltz, ganoro, kalin.a, zhaozhongwei | ||||||||||
| Version: | unspecified | ||||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | Macintosh | ||||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Christ van Willegen
Created attachment 184840 [details]
Test case showing incorrect syntax coloring
Created attachment 185104 [details]
patch
committed to head,thanks Xu! (In reply to comment #3) > committed to head,thanks Xu! Just to be sure, is this a valid PHP code? can you run it with the php binary and get no errors when executing it? Thanks! hi,Roy
I use this php file to test:
<?php
function echoHereDoc($hereDoc)
{
echo $hereDoc;
}
/**
* TODO abscsfdds
* Enter description here ...
*/
function test()
{
echoHereDoc(<<<EOF
set term png size 1300, 600
set xdata time
set xlabel "$test"
set ylabel "Aantal per minuut"
set timefmt "%Y-%m-%d_%H:%M"
set format x "%H:%M:%S"
set key outside bottom
set output "/var/www/html/arponline/arponline.data/plot.png"
plot
EOF
);
}
test();
and it print:
set term png size 1300, 600
set xdata time
set xlabel "Test"
set ylabel "Aantal per minuut"
set timefmt "%Y-%m-%d_%H:%M"
set format x "%H:%M:%S"
set key outside bottom
set output "/var/www/html/arponline/arponline.data/plot.png"
plot
so I think it is a valid php code,and I will write test for it and fix the unit test failure:)
Great, so it sounds like an important issue that we need to apply to the branch as well. Do we have unit tests for this issue? (In reply to comment #6) > Great, so it sounds like an important issue that we need to apply to the branch > as well. > > Do we have unit tests for this issue? not yet,I will add it tomorrow there is problem with Xu's patch.for example: <? <<<MY_MARKER Hello world Bye Bye world Bla Bla Bla MY_MARKER; b<<<MY_MARKER_2 Hello world Bye Bye world Bla Bla Bla MY_MARKER_2; <<<"MY_MARKER_3" Hello world Bye Bye world Bla Bla Bla MY_MARKER_3; Created attachment 186472 [details]
patch
patch and unit test
Still reproducible using the code in Comment 8 See the attachment. Created attachment 200589 [details]
screenshot1
fixed (In reply to comment #11) > Created attachment 200589 [details] > screenshot1 Because the last "MY_MARKER_3;" is *not* the end of heredoc(T_END_HEREDOC). Run the script. You get Parsing Error: /php/errfile.php line 16 - syntax error, unexpected $end, expecting T_VARIABLE or T_END_HEREDOC or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN Ok,thanks Toshihiro! I'm closing it, since the given example in Comment 8 is not good. |