Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions PowerShell.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,24 @@ contexts:
2: punctuation.definition.numeric.base.powershell
3: storage.type.numeric.powershell
4: keyword.other.unit.powershell
- match: |-
(?x:
(
\b{{dec_digits}}
(?:
(?:
(?:(?:\.(?!\.))\d*) # No `_` after the `.`
{{dec_exponent}}?
| {{dec_exponent}}
)
(?:{{integer_suffix}})
)
)
({{bytes_unit}}\b)?
)
captures:
1: invalid.deprecated.powershell
2: keyword.other.unit.powershell
- match: |-
(?x:
(
Expand Down
10 changes: 8 additions & 2 deletions Tests/syntax_test_PowerShell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,14 @@ There is no @platting here!
1.d
# ^^^ constant.numeric.float
1.lGB
# ^^^ constant.numeric.float - unclear whether float or int
# ^^^ invalid.deprecated
# ^^ keyword.other.unit
1.2345e1LGB
# ^^^^^^^^^ invalid.deprecated
# ^^ keyword.other.unit
1.2345e-5LGB
# ^^^^^^^^^^ invalid.deprecated
# ^^ keyword.other.unit
1.dGB
# ^^^ constant.numeric.float
# ^^ keyword.other.unit
Expand Down Expand Up @@ -524,7 +530,7 @@ There is no @platting here!
# ^ keyword.operator
-10.002L
# ^ keyword.operator.unary
# ^^^^^^^ constant.numeric.float - unclear whether float or int
# ^^^^^^^ invalid.deprecated
$x..5.40D
# ^ punctuation.definition.variable
# ^^ variable.other.readwrite
Expand Down
Loading