Skip to content

Commit 8edec81

Browse files
committed
Mark ambiguous float / long as deprecated
Microsoft themselves warn against using that kind of notation. Tests changed to reflect the new designation.
1 parent 11aecf6 commit 8edec81

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

PowerShell.sublime-syntax

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,24 @@ contexts:
555555
2: punctuation.definition.numeric.base.powershell
556556
3: storage.type.numeric.powershell
557557
4: keyword.other.unit.powershell
558+
- match: |-
559+
(?x:
560+
(
561+
\b{{dec_digits}}
562+
(?:
563+
(?:
564+
(?:(?:\.(?!\.))\d*) # No `_` after the `.`
565+
{{dec_exponent}}?
566+
| {{dec_exponent}}
567+
)
568+
(?:{{integer_suffix}})
569+
)
570+
)
571+
({{bytes_unit}}\b)?
572+
)
573+
captures:
574+
1: invalid.deprecated.powershell
575+
2: keyword.other.unit.powershell
558576
- match: |-
559577
(?x:
560578
(

Tests/syntax_test_PowerShell.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,14 @@ There is no @platting here!
476476
1.d
477477
# ^^^ constant.numeric.float
478478
1.lGB
479-
# ^^^ constant.numeric.float - unclear whether float or int
479+
# ^^^ invalid.deprecated
480480
# ^^ keyword.other.unit
481+
1.2345e1LGB
482+
# ^^^^^^^^^ invalid.deprecated
483+
# ^^ keyword.other.unit
484+
1.2345e-5LGB
485+
# ^^^^^^^^^^ invalid.deprecated
486+
# ^^ keyword.other.unit
481487
1.dGB
482488
# ^^^ constant.numeric.float
483489
# ^^ keyword.other.unit
@@ -524,7 +530,7 @@ There is no @platting here!
524530
# ^ keyword.operator
525531
-10.002L
526532
# ^ keyword.operator.unary
527-
# ^^^^^^^ constant.numeric.float - unclear whether float or int
533+
# ^^^^^^^ invalid.deprecated
528534
$x..5.40D
529535
# ^ punctuation.definition.variable
530536
# ^^ variable.other.readwrite

0 commit comments

Comments
 (0)