diff --git a/PowerShell.sublime-syntax b/PowerShell.sublime-syntax index ad864df..d8e3530 100644 --- a/PowerShell.sublime-syntax +++ b/PowerShell.sublime-syntax @@ -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: ( diff --git a/Tests/syntax_test_PowerShell.ps1 b/Tests/syntax_test_PowerShell.ps1 index b882559..fb21318 100644 --- a/Tests/syntax_test_PowerShell.ps1 +++ b/Tests/syntax_test_PowerShell.ps1 @@ -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 @@ -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