1 # PowerShell syntax highlighting file for micro - https://micro-editor.github.io/
2 # PowerShell syntax taken from: https://github.com/PowerShell/EditorSyntax
7 filename: "\\.ps(1|m1|d1)$"
11 # - comment.block: # Block Comment
12 # - comment.doc: # Doc Comment
13 # - comment.line: # Line Comment
14 # - comment.shebang: # Shebang Line
16 # - constant: # Constant
17 # - constant.bool: # Constant (true, false)
18 # - constant.interpolation:
19 # - constant.number: # Constant (null)
20 # - constant.specialChar:
21 # - constant.string: # String
22 # - constant.string.char:
23 # - constant.string.url: # Uri
26 # - identifier: # Also used for functions
27 # - identifier.class: # Also used for functions
31 # - preproc: # Preprocessor
32 # - preproc.DebugIdentifier: # Preprocessor
33 # - preproc.shebang: # The #! at the beginning of a file that tells the os what script interpreter to use
35 # - special: # Special (global|local|private|script|using|workflow)
37 # - statement: # Statements Keywords
38 # - statement.built_in:
39 # - statement.declaration: # Declaration Keywords
40 # - statement.meta: # Meta
41 # - statement.reserved: # Reserved Keywords
44 # - symbol.brackets: # {}()[] and sometimes <>
45 # - symbol.operator: # Operators
46 # - symbol.tag: # For html tags, among other things
49 # - type.collections: # Collections (array, hashtable)
50 # - type.ctypes: # CTypes (CBool, CChar, etc.)
51 # - type.keyword: # If you want a special highlight for keywords like 'private'
52 # - type.storage: # Storage Types (int, uint, string, etc.)
55 - identifier.class: "class +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?"
56 - identifier.class: "(function)(?:([[:space:]][A-Za-z0-9]+[[:space:]]*))"
58 # Verbs taken from PwSh 6.0.2
59 - identifier: "(Add|Approve|Assert|Backup|Block|Build|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy)[-][A-Za-z0-9]+"
60 - identifier: "(Debug|Deny|Deploy|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide)[-][A-Za-z0-9]+"
61 - identifier: "(Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push)[-][A-Za-z0-9]+"
62 - identifier: "(Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke)[-][A-Za-z0-9]+"
63 - identifier: "(Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace)[-][A-Za-z0-9]+"
64 - identifier: "(Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write)[-][A-Za-z0-9]+"
65 - identifier.var: "\\$(?i)((Global|Local|Private|Script|Using|Workflow)[:])?[A-Za-z0-9]*"
68 # Expression and types
69 - type: "\\[\\b([A-Za-z]+|[A-Za-z]+[0-9]+)\\b\\]"
72 - statement: "\\b(alias|as|begin|break|catch|continue|data|default|define|do|dynamicparam)\\b"
73 - statement: "\\b(else|elseif|end|exit|finally|for|foreach|foreach-object|from|if|in|inlinescript)\\b"
74 - statement: "\\b(parallel|param|process|return|switch|throw|trap|try|until|using|var|where|where-object|while)\\b"
77 - special: "\\b(break|continue|exit)\\b"
79 - symbol.brackets: "(\\{|\\})"
80 - symbol.brackets: "(\\(|\\))"
81 - symbol.brackets: "(\\[|\\])"
82 - symbol.operator: "[\\-+/*=<>?:!~%&|]"
83 - symbol.operator: "[[:space:]][-](ne|eq|gt|ge|lt|le|like|notlike|match|notmatch|contains|notcontains|in|notin|replace|is|isnot)[[:space:]]"
86 - constant.bool: "\\b\\$(true|false|null)\\b"
87 - constant.number: "\\b([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\\b"
89 # Expression Mode String
95 - constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
96 - constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
98 # Argument Mode String
104 - constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
105 - constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
112 - todo: "(TODO|XXX|FIXME|BUG):?"
119 - todo: "(TODO|XXX|FIXME|BUG):?"
129 - todo: "(TODO|XXX|FIXME|BUG):?"