[TxMt] PHP Grammar / Syntax Highlight Bug

GreyWyvern bhuisman at greywyvern.com
Fri Jan 22 22:34:50 UTC 2010


The following two valid PHP snippets trip up the PHP grammar in TextMate. 
Mostly because of unusually nested quotes and braces:

Snippet #1:
<?php
$str = array("Foo", "Bar");
echo "Name: {$str[($str[1]) ? 1 : 0]}"; // Should echo "Name: Bar"
?>

The text "($str[1" appears highlighted as a syntax error


Snippet #2
<?php
$insert = mysql_query("INSERT INTO `catalogue` SET
  `model`='{$_POST["page_row{$count}_model"]}',
  `type`='{$_POST["page_row{$count}_type"]}',
  `updated`=UNIX_TIMESTAMP()
;");
?>

Everything in the document after this snippet is treated as a string.

Hopefully these are simple grammar file fixes :)

Cheers,
Brian
-- 
View this message in context: http://old.nabble.com/PHP-Grammar---Syntax-Highlight-Bug-tp27280995p27280995.html
Sent from the textmate users mailing list archive at Nabble.com.




More information about the textmate mailing list