"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/ps1.lang" (12 May 2020, 4088 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "ps1.lang": 3.56_vs_3.57.

    1 Description="Microsoft PowerShell"
    2 
    3 Categories = {"source", "script", "shell"}
    4 
    5 Identifiers=[[ [a-zA-Z_][\w\-]* ]]
    6 
    7 Keywords={
    8   { Id=1,
    9     List={"Add-Content", "Add-History", "Add-Member", "Add-PSSnapin",
   10         "Clear-Content", "Clear-Item", "Clear-ItemProperty", "Clear-Variable",
   11         "Compare-Object", "ConvertFrom-SecureString",
   12         "Convert-Path", "ConvertTo-Html", "ConvertTo-SecureString", "Copy-Item",
   13         "Copy-ItemProperty", "Export-Alias", "Export-Clixml", "Export-Console",
   14         "Export-Csv", "ForEach-Object", "Format-Custom",
   15         "Format-List", "Format-Table", "Format-Wide", "Get-Acl", "Get-Alias",
   16         "Get-AuthenticodeSignature", "Get-ChildItem", "Get-Command", "Get-Content",
   17         "Get-Credential", "Get-Culture", "Get-Date",
   18         "Get-EventLog", "Get-ExecutionPolicy", "Get-Help", "Get-History",
   19         "Get-Host", "Get-Item", "Get-ItemProperty", "Get-Location", "Get-Member",
   20         "Get-PfxCertificate", "Get-Process", "Get-PSDrive",
   21         "Get-PSProvider", "Get-PSSnapin", "Get-Service", "Get-TraceSource",
   22         "Get-UICulture", "Get-Unique", "Get-Variable", "Get-WmiObject", "Group-Object",
   23         "Import-Alias", "Import-Clixml", "Import-Csv",
   24         "Invoke-Expression", "Invoke-History", "Invoke-Item", "Join-Path",
   25         "Measure-Command", "Measure-Object", "Move-Item", "Move-ItemProperty",
   26         "New-Alias", "New-Item", "New-ItemProperty", "New-Object", "Write-host",
   27         "New-PSDrive", "New-Service", "New-TimeSpan", "New-Variable", "Out-Default",
   28         "Out-File", "Out-Host", "Out-Null", "Out-Printer", "Out-String", "Pop-Location",
   29         "Push-Location", "Read-Host",
   30         "Remove-Item", "Remove-ItemProperty", "Remove-PSDrive", "Remove-PSSnapin",
   31         "Remove-Variable", "Rename-Item", "Rename-ItemProperty", "Resolve-Path",
   32         "Restart-Service", "Resume-Service", "Select-Object",
   33         "Select-String", "Set-Acl", "Set-Alias", "Set-AuthenticodeSignature",
   34         "Set-Content", "Set-Date", "Set-ExecutionPolicy", "Set-Item",
   35         "Set-ItemProperty", "Set-Location", "Set-PSDebug", "Set-Service",
   36         "Set-TraceSource", "Set-Variable", "Sort-Object", "Split-Path",
   37         "Start-Service", "Start-Sleep", "Start-Transcript", "Stop-Process",
   38         "Stop-Service", "Stop-Transcript", "Suspend-Service", "Tee-Object",
   39         "Test-Path", "Trace-Command", "Update-FormatData", "Update-TypeData",
   40         "Where-Object", "Write-Debug",
   41         "Write-Error", "Write-Host", "Write-Output", "Write-Progress",
   42         "Write-Verbose", "Write-Warning", "switch", "function", "if", "throw", "else",
   43         "while", "break", "in", "return", "try", "catch", "for"},
   44   },
   45   { Id=2,
   46     List={"ac", "asnp", "clc", "cli", "clp", "clv", "cpi", "cpp", "cvpa",
   47         "diff", "epal", "epcsv", "fc", "fl", "foreach", "%", "ft", "fw", "gal", "gc",
   48         "gci", "gcm", "gdr", "ghy", "gi", "gl", "gm", "gp",
   49         "gps", "group", "gsv", "gsnp", "gu", "gv", "gwmi", "iex", "ihy", "ii",
   50         "ipal", "ipcsv", "mi", "mp", "nal", "ndr", "ni", "nv", "oh", "rdr", "ri", "rni",
   51         "rnp", "rp", "rsnp", "rv", "rvpa", "sal", "sasv",
   52         "sc", "select", "si", "sl", "sleep", "sort", "sp", "spps", "spsv", "sv",
   53         "tee", "where", "write", "cat", "cd", "clear", "cp", "h", "history",
   54         "kill", "lp", "ls", "mount", "mv", "popd", "ps", "pushd",
   55         "pwd", "r", "rm", "rmdir", "echo", "cls", "chdir", "copy", "del", "dir",
   56         "erase", "move", "rd", "ren", "set", "type"},
   57   },
   58   { Id=3,
   59     Regex=[[Win32_\w+]],
   60   },
   61   { Id=4,
   62     Regex=[[\$\w+]],
   63   },
   64 }
   65 
   66 Strings={
   67   Delimiter=[["|']],
   68   Escape=[[ `\d{3}|`x\d{2}|^[ntvbrfa`\?'"] ]],
   69     Interpolation=[[ \$\w+|\$\(.+?\) ]],
   70 }
   71 
   72 IgnoreCase=false
   73 
   74 Comments={
   75   { Block=false,
   76     Delimiter= { [[#]] },
   77   },
   78 }
   79 
   80 Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\.|\:|\&|<|>|\!|\=|\/|\*|\%|\+|\-|\~|\?|\||\.]]
   81 
   82 EnableIndentation=false
   83 
   84 -- fix recognition of $
   85 function OnStateChange(oldState, newState, token)
   86 
   87   if  (string.sub(token,1,1) =="$") and oldState==HL_STRING and newState==HL_KEYWORD then
   88     return HL_INTERPOLATION
   89   end
   90 
   91 end