Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c5e1c47

Browse files
committed
Merge pull request #41 from nightwing/master
String parsing issues
2 parents 8742634 + 0943b0b commit c5e1c47

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/parser/lexer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ PHP.Lexer = function( src, ini ) {
535535

536536
result = result.substring( match[ 0 ].length );
537537

538-
match = result.match(/^(\-\>)([a-zA-Z0-9_\x7f-\xff]*)/);
538+
match = result.match(/^(\-\>)\s*([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*(\()/);
539539

540540
if ( match !== null ) {
541541

@@ -549,6 +549,8 @@ PHP.Lexer = function( src, ini ) {
549549
match[ 2 ],
550550
line
551551
]);
552+
if (match[3])
553+
results.push(match[3]);
552554
result = result.substring( match[ 0 ].length );
553555
}
554556

@@ -560,9 +562,9 @@ PHP.Lexer = function( src, ini ) {
560562

561563
var re;
562564
if ( curlyOpen > 0) {
563-
re = /^([^\\\$"{}\]]|\\.)+/g;
565+
re = /^([^\\\$"{}\])]|\\.)+/g;
564566
} else {
565-
re = /^([^\\\$"{]|\\.|{[^\$])+/g;
567+
re = /^([^\\\$"{]|\\.|{[^\$]|\$(?=[^a-zA-Z_\x7f-\xff]))+/g;;
566568
}
567569

568570
while(( match = result.match( re )) !== null ) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /