Skip to content

Commit

Permalink
Merge branch 'issue6-array-string-macro' into develop
Browse files Browse the repository at this point in the history
* issue6-array-string-macro:
  🐛 fix #6 short array syntax scope
  • Loading branch information
gerardroche committed Feb 11, 2015
2 parents 42d7e16 + af7f6ec commit 43b236d
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PHP.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,7 @@
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.array.begin.php</string>
<string>punctuation.definition.array.begin.php</string>
</dict>
</dict>
<key>end</key>
Expand All @@ -2119,9 +2119,11 @@
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.array.end.php</string>
<string>punctuation.definition.array.end.php</string>
</dict>
</dict>
<key>name</key>
<string>meta.array.php</string>
<key>patterns</key>
<array>
<dict>
Expand Down
70 changes: 70 additions & 0 deletions test/language/issue6_short_array_syntax_test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
--TEST--
Short array syntax as of 5.4
--FILE--
<?php

$x = array();
$x = [];

$x = array( );
$x = [ ];

$x = array(
'x'
);
$x = [
'x'
];

?>
--EXPECT--
match:2:5:meta.array.empty.php support.function.construct.php
match:2:6:meta.array.empty.php support.function.construct.php
match:2:7:meta.array.empty.php support.function.construct.php
match:2:8:meta.array.empty.php support.function.construct.php
match:2:9:meta.array.empty.php support.function.construct.php
match:2:10:meta.array.empty.php punctuation.definition.array.begin.php
match:2:11:meta.array.empty.php punctuation.definition.array.end.php
match:3:5:meta.array.php punctuation.definition.array.begin.php
match:3:6:meta.array.php punctuation.definition.array.end.php

match:5:5:meta.array.php support.function.construct.php
match:5:6:meta.array.php support.function.construct.php
match:5:7:meta.array.php support.function.construct.php
match:5:8:meta.array.php support.function.construct.php
match:5:9:meta.array.php support.function.construct.php
match:5:10:meta.array.php punctuation.definition.array.begin.php
match:5:11:meta.array.php
match:5:12:meta.array.php punctuation.definition.array.end.php
match:6:5:meta.array.php punctuation.definition.array.begin.php
match:6:6:meta.array.php
match:6:7:meta.array.php punctuation.definition.array.end.php

match:8:5:meta.array.php support.function.construct.php
match:8:6:meta.array.php support.function.construct.php
match:8:7:meta.array.php support.function.construct.php
match:8:8:meta.array.php support.function.construct.php
match:8:9:meta.array.php support.function.construct.php
match:8:10:meta.array.php punctuation.definition.array.begin.php
match:8:11:meta.array.php
match:9:0:meta.array.php
match:9:1:meta.array.php
match:9:2:meta.array.php
match:9:3:meta.array.php
match:9:4:meta.array.php string.quoted.single.php punctuation.definition.string.begin.php
match:9:5:meta.array.php string.quoted.single.php meta.string-contents.quoted.single.php
match:9:6:meta.array.php string.quoted.single.php punctuation.definition.string.end.php
match:9:7:meta.array.php

match:10:0:meta.array.php punctuation.definition.array.end.php
match:11:5:meta.array.php punctuation.definition.array.begin.php
match:11:6:meta.array.php
match:12:0:meta.array.php
match:12:1:meta.array.php
match:12:2:meta.array.php
match:12:3:meta.array.php
match:12:4:meta.array.php string.quoted.single.php punctuation.definition.string.begin.php
match:12:5:meta.array.php string.quoted.single.php meta.string-contents.quoted.single.php
match:12:6:meta.array.php string.quoted.single.php punctuation.definition.string.end.php
match:12:7:meta.array.php
match:13:0:meta.array.php punctuation.definition.array.end.php

0 comments on commit 43b236d

Please sign in to comment.