Powershell lexer
The are missing built-in variables:
The are additional operators related to strings (I should have listed the operators with case-sensitivity), only the i* and c* variants are missing:
Some operators could be highlighted not as symbols:
related to calling and parameters: & -- --%
the ++ -- increment/decrement operators
static member access: :: (double colon)
assignment: += -= *= /= %=
https://i.imgur.com/i5VOcU1.png
Thank you!
Code: Select all
$ErrorActionPreference
$ConfirmPreference
$WhatIfPreference
$DebugPreference
$ProgressPreference
$VerbosePreference
$WarningPreference
$InformationPreference
$MaximumAliasCount
$MaximumDriveCount
$MaximumErrorCount
$MaximumFunctionCount
$MaximumHistoryCount
$MaximumVariableCount
$ErrorView
$PSEmailServer
$PSModuleAutoLoadingPreference
$PSDefaultParameterValues
$PSSessionApplicationName
$PSSessionConfigurationName
$PSSessionOption
Code: Select all
-replace -ireplace -creplace
-split -isplit -csplit
-like -ilike -clike
-notlike -inotlike -cnotlike
-contains -icontains -ccontains
-notcontains -inotcontains -cnotcontains
-in -iin -cin
-notin -inotin -cnotin
-match -imatch -cmatch
-notmatch -inotmatch -cnotmatch
related to calling and parameters: & -- --%
the ++ -- increment/decrement operators
static member access: :: (double colon)
assignment: += -= *= /= %=
https://i.imgur.com/i5VOcU1.png
Code: Select all
# highlight as variable the ${...}
# the name is "a very ugly variable name in the braces {} ..."
${a very ugly variable name in the braces `{`} ...} = "12345"
# another weird name
${foreach and switch var} = "it is legal"
# highlight types as [type-name] or just the type-name
# types are in brackets
[switch] $w
# the switch statement is highlighted as type
switch ( )
{ }
# better keyword/statement detection ?
# there is no "-" before them
# begin/process/end {...} are script blocks
# function must be followed an "identifier {...}" part
Some-Cmdlet -Process -Switch -Begin { }
Sort-Object -Property Function,Other
Video about a small glitch, when the closing "@ characters are in the right position again, the comment does not be highlghted.
https://streamable.com/g4t22
https://streamable.com/g4t22
Fixed most of issues
- "function" without Id name - still is keyword, it is ok to hilite all keywords in all places, even w/o next Id.
- here-strings @" ... "@ - do you type spaces after @" ? here strings cannot have space there -
https://powershell.org/2019/04/hear-hea ... e-strings/
- "function" without Id name - still is keyword, it is ok to hilite all keywords in all places, even w/o next Id.
- here-strings @" ... "@ - do you type spaces after @" ? here strings cannot have space there -
https://powershell.org/2019/04/hear-hea ... e-strings/
Hello!
The "#Requires ..." statement is highlighted as comment not as statement or some other category.
https://docs.microsoft.com/en-us/powers ... wershell-7
Thanks
The "#Requires ..." statement is highlighted as comment not as statement or some other category.
https://docs.microsoft.com/en-us/powers ... wershell-7
Thanks