php-mode icon indicating copy to clipboard operation
php-mode copied to clipboard

Heredoc/Nowdoc highlighting issue

Open zonuexe opened this issue 7 years ago • 3 comments

Since this pattern consists of \w+, consideration to _ is missing. Moreover, it does not correspond to the <<<"heredoc" style.

2018-03-10 0 53 23 2018-03-10 0 55 02

zonuexe avatar Mar 09 '18 15:03 zonuexe

Nowdoc highlighting breaks for me in this file, it seems that the cause is somewhere in the preceding comment. Screenshot_20210422_030816

<?php

/*
 * # Log file format version (1.0/1.1) 1.1 adds the MusicBrainz Track ID column, specifies UTF-8 encoding of strings.
 * # Time zone (UTC|UNKNOWN) If the device knows its timezone it logs the timestamps in UTC, otherwise they TZ-less and need correction.
 * # Device ID
 * Body (one line per track):
 * | Artist | [Album] | Track | [Track #] | Duration (seconds) | Rating | Timestamp | [TrackID] |
 * If an optional field has no data it is left blank (\t\t)
 * UTF-8 w/o BOM
 */

$play_log = <<<'LOG'
#AUDIOSCROBBLER/1.1
#TZ/UNKNOWN
#CLIENT/Rockbox sansaclipplus $Revision$
Art Blakey and The Jazz Messengers	Moanin'	Moanin'	1	575	L	1616975543
Art Blakey and The Jazz Messengers	Moanin'	Are You Real	2	290	S	1616976122
Art Blakey and The Jazz Messengers	Moanin'	Along Came Betty	3	372	S	1616976132
Art Blakey and The Jazz Messengers	Moanin'	The Drum Thunder Suite	4	455	L	1616976134
Art Blakey and The Jazz Messengers	Moanin'	Blues March	5	378	L	1616976589
Art Blakey and The Jazz Messengers	Moanin'	Come Rain or Come Shine	6	348	L	1616976967
LOG;

$API_ENDPOINT = 'http://ws.audioscrobbler.com/2.0/';
$API_KEY = '';
$API_SHARED_SECRET = '';

efermi avatar Apr 22 '21 00:04 efermi

@efermi Thank you for reporting. I reproduced the problem in my environment.

This is certainly similar to the existing problem, but the situation is a bit complicated.

スクリーンショット 2021-04-22 10 27 05 スクリーンショット 2021-04-22 10 27 21

This looks like a problem with the PHP Mode coloring algorithm, so I'll find and investigate a lot of time.

zonuexe avatar Apr 22 '21 07:04 zonuexe

Thank you for looking into it.

efermi avatar Apr 22 '21 07:04 efermi

It looks fine in Emacs 28 and above.

zonuexe avatar Nov 23 '23 23:11 zonuexe