The lexer for PHP syntax highlighter doesn't end a literal token when a comment is started.
Apostrophes in the comment are therefore considered part of a string literal and need to be paired.
at least SCE_HPHP_COMMENTLINE is missing as in above SCE_HPHP_WORD, possible the entire case SCE_HPHP_NUMBER can be removed, this is the only case that handles number, other scripts only has case xxx__WORD, and mostly works except for exponent like
<script>vara=1.23e-4;/* +- not highlighted as number */</script>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's javascript (says <script> not <?php). Threw me off as well at first. I think I've fixed it with my patch. (And I've applied your principle of minimal change though I really wanted to rewrite some things, but meh.)
Last edit: Dejan Budimir 2020-02-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This patch appears to fix the issue but it should be thoroughly checked by someone with more PHP experience than me.
at least SCE_HPHP_COMMENTLINE is missing as in above SCE_HPHP_WORD, possible the entire case SCE_HPHP_NUMBER can be removed, this is the only case that handles number, other scripts only has case xxx__WORD, and mostly works except for exponent like
This doesn't appear to be about PHP. For PHP, this sample lexes with '-' as number:
It's javascript (says
<script>not<?php). Threw me off as well at first. I think I've fixed it with my patch. (And I've applied your principle of minimal change though I really wanted to rewrite some things, but meh.)Last edit: Dejan Budimir 2020-02-01
This should work. Based on Neil's patch. Cheers.
Added test case [a299df].
First hunk of LexHTML.cxx.patch does not appear to be connected to this bug.
Related
Commit: [a299df]
Should I split the patch up and create another ticket for the JavaScript bug?
Each bug should be a separate issue on the tracker and should have a test case in lexilla/test/examples.
Fix committed with Lexilla issue #20.
https://github.com/ScintillaOrg/lexilla/issues/20