Skip to content

Commit e4072e6

Browse files
omniomiTylerLeonhardt
authored andcommitted
fixing hashtables (#84)
1 parent 111ebd3 commit e4072e6

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@
9696
<key>include</key>
9797
<string>#type</string>
9898
</dict>
99+
<dict>
100+
<key>include</key>
101+
<string>#hashtable</string>
102+
</dict>
99103
<dict>
100104
<key>begin</key>
101105
<string>(?&lt;!(?&lt;!`)")"</string>
@@ -1437,6 +1441,67 @@
14371441
</dict>
14381442
</array>
14391443
</dict>
1444+
<key>hashtable</key>
1445+
<dict>
1446+
<key>begin</key>
1447+
<string>(@\{)</string>
1448+
<key>beginCaptures</key>
1449+
<dict>
1450+
<key>1</key>
1451+
<dict>
1452+
<key>name</key>
1453+
<string>punctuation.section.braces.begin</string>
1454+
</dict>
1455+
</dict>
1456+
<key>end</key>
1457+
<string>(\})</string>
1458+
<key>endCaptures</key>
1459+
<dict>
1460+
<key>1</key>
1461+
<dict>
1462+
<key>name</key>
1463+
<string>punctuation.section.braces.end</string>
1464+
</dict>
1465+
</dict>
1466+
<key>name</key>
1467+
<string>meta.hashtable.powershell</string>
1468+
<key>patterns</key>
1469+
<array>
1470+
<dict>
1471+
<key>captures</key>
1472+
<dict>
1473+
<key>1</key>
1474+
<dict>
1475+
<key>name</key>
1476+
<string>punctuation.definition.string.begin</string>
1477+
</dict>
1478+
<key>2</key>
1479+
<dict>
1480+
<key>name</key>
1481+
<string>variable.other.readwrite.powershell</string>
1482+
</dict>
1483+
<key>3</key>
1484+
<dict>
1485+
<key>name</key>
1486+
<string>punctuation.definition.string.end</string>
1487+
</dict>
1488+
<key>4</key>
1489+
<dict>
1490+
<key>name</key>
1491+
<string>keyword.operator.assignment.powershell</string>
1492+
</dict>
1493+
</dict>
1494+
<key>match</key>
1495+
<string>\b((?:\'|\")?)(\w+)((?:\'|\")?)(?:\s+)?(=)(?:\s+)?</string>
1496+
<key>name</key>
1497+
<string>meta.hashtable.assignment.powershell</string>
1498+
</dict>
1499+
<dict>
1500+
<key>include</key>
1501+
<string>$self</string>
1502+
</dict>
1503+
</array>
1504+
</dict>
14401505
</dict>
14411506
<key>scopeName</key>
14421507
<string>source.powershell</string>

examples/TheBigTestFile.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ $variable-name
7070
$properties = @{
7171
Name = 'Name'
7272
Something = $else
73-
Number = 16
73+
Number = 16
74+
from = 'hello world'
75+
hash = @{
76+
hello = 'world'
77+
}
7478
}
7579

7680
# Spatting

0 commit comments

Comments
 (0)