Skip to content

Commit 2f3144f

Browse files
committed
Fix data section not popping
1 parent cba79c8 commit 2f3144f

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

PowerShell.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ contexts:
729729
inside-data-block:
730730
- match: \}
731731
scope: punctuation.section.block.end.powershell
732-
pop: 1
732+
pop: 2
733733
# Data sections use a subset of Pwsh, but we don't distinguish yet.
734734
- include: statements
735735

Tests/syntax_test_PowerShell.ps1

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,21 +1011,7 @@ switch ('this') {
10111011
"It is provided free of charge to the community."
10121012
"I appreciate your comments and feedback."
10131013
}
1014-
1015-
data TextMsgs {
1016-
#^^^^^^^^^^^^^^^^^^ meta.block.data.powershell
1017-
# ^^^^ keyword.control.context.powershell
1018-
# ^^^^^^^^ entity.name.section.powershell
1019-
# ^ punctuation.section.block.begin.powershell
1020-
ConvertFrom-StringData -StringData @'
1021-
# @@@@@@@@@@@@@@@@@@@@@@ reference
1022-
Text001 = Windows 7
1023-
Text002 = Windows Server 2008 R2
1024-
'@
1025-
}
1026-
1027-
$TextMsgs
1028-
1014+
# ^ - meta
10291015

10301016
# Functions and filters
10311017
functioN MyFunction{}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SYNTAX TEST partial-symbols "Packages/PowerShell/PowerShell.sublime-syntax"
2+
3+
4+
data TextMsgs {
5+
# ^^^^^^^^^^^^^^^ meta.block.data.powershell
6+
# ^^^^ keyword.control.context.powershell
7+
# ^^^^^^^^ entity.name.section.powershell
8+
# ^ punctuation.section.block.begin.powershell
9+
ConvertFrom-StringData -StringData @'
10+
# @@@@@@@@@@@@@@@@@@@@@@ reference
11+
Text001 = Windows 7
12+
Text002 = Windows Server 2008 R2
13+
'@
14+
}
15+
16+
$TextMsgs

0 commit comments

Comments
 (0)