1 | <?xml version="1.0"?> |
---|
2 | <SyntaxDefinition name="PowerShell" extensions=".ps1;.psm1;.psd1" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008"> |
---|
3 | <Color name="Comment" foreground="Green" exampleText="// comment" /> |
---|
4 | <Color name="String" foreground="Blue" exampleText="string text = "Hello, World!""/> |
---|
5 | <Color name="Char" foreground="Magenta" exampleText="char linefeed = '\n';"/> |
---|
6 | <Color name="Punctuation" exampleText="a(b.c);" /> |
---|
7 | <Color name="NumberLiteral" foreground="DarkBlue" exampleText="3.1415f"/> |
---|
8 | <Color name="Keywords" fontWeight="bold" foreground="Blue" exampleText="if (a)"/> |
---|
9 | <Color name="Variable" foreground="Maroon" exampleText="$param = 1" /> |
---|
10 | <Color name="ExceptionKeywords" fontWeight="bold" foreground="Teal" /> |
---|
11 | <Color name="GotoKeywords" foreground="Navy" /> |
---|
12 | <Color name="ReferenceTypes" foreground="Red" /> |
---|
13 | <Color name="Command" fontWeight="bold" foreground="MidnightBlue" /> |
---|
14 | <Color name="Operators" foreground="#FF8515EA" exampleText="-eq"/> |
---|
15 | |
---|
16 | <RuleSet ignoreCase="true"> |
---|
17 | <Span color="Comment"> |
---|
18 | <Begin>\#</Begin> |
---|
19 | </Span> |
---|
20 | |
---|
21 | <Span color="Comment" multiline="true"> |
---|
22 | <Begin><\#</Begin> |
---|
23 | <End>\#></End> |
---|
24 | </Span> |
---|
25 | |
---|
26 | <Span color="String"> |
---|
27 | <Begin>"</Begin> |
---|
28 | <End>"</End> |
---|
29 | <RuleSet> |
---|
30 | <!-- span for escape sequences --> |
---|
31 | <Span begin="\\" end="."/> |
---|
32 | </RuleSet> |
---|
33 | </Span> |
---|
34 | |
---|
35 | <Span color="Char"> |
---|
36 | <Begin>'</Begin> |
---|
37 | <End>'</End> |
---|
38 | <RuleSet> |
---|
39 | <!-- span for escape sequences --> |
---|
40 | <Span begin="\\" end="."/> |
---|
41 | </RuleSet> |
---|
42 | </Span> |
---|
43 | |
---|
44 | <Span color="String" multiline="true"> |
---|
45 | <Begin color="String">@"</Begin> |
---|
46 | <End>"@</End> |
---|
47 | <RuleSet> |
---|
48 | <!-- span for escape sequences --> |
---|
49 | <Span begin='""' end=""/> |
---|
50 | </RuleSet> |
---|
51 | </Span> |
---|
52 | |
---|
53 | <Keywords color="Keywords"> |
---|
54 | <Word>while</Word> |
---|
55 | <Word>param</Word> |
---|
56 | <Word>end</Word> |
---|
57 | <Word>define</Word> |
---|
58 | <Word>else</Word> |
---|
59 | <Word>from</Word> |
---|
60 | <Word>foreach</Word> |
---|
61 | <Word>var</Word> |
---|
62 | <Word>dynamicparam</Word> |
---|
63 | <Word>filter</Word> |
---|
64 | <Word>dp</Word> |
---|
65 | <Word>until</Word> |
---|
66 | <Word>for</Word> |
---|
67 | <Word>exit</Word> |
---|
68 | <Word>switch</Word> |
---|
69 | <Word>process</Word> |
---|
70 | <Word>begin</Word> |
---|
71 | <Word>elseif</Word> |
---|
72 | <Word>if</Word> |
---|
73 | <Word>in</Word> |
---|
74 | <Word>data</Word> |
---|
75 | <Word>class</Word> |
---|
76 | <Word>using</Word> |
---|
77 | <Word>function</Word> |
---|
78 | </Keywords> |
---|
79 | |
---|
80 | <Keywords color="ExceptionKeywords"> |
---|
81 | <Word>catch</Word> |
---|
82 | <Word>finally</Word> |
---|
83 | <Word>throw</Word> |
---|
84 | <Word>trap</Word> |
---|
85 | <Word>try</Word> |
---|
86 | </Keywords> |
---|
87 | |
---|
88 | <Keywords color="GotoKeywords"> |
---|
89 | <Word>break</Word> |
---|
90 | <Word>continue</Word> |
---|
91 | <Word>return</Word> |
---|
92 | </Keywords> |
---|
93 | |
---|
94 | <Keywords color="ReferenceTypes"> |
---|
95 | <Word>class</Word> |
---|
96 | </Keywords> |
---|
97 | |
---|
98 | <Keywords color="Operators"> |
---|
99 | <Word>-not</Word> |
---|
100 | <Word>-band</Word> |
---|
101 | <Word>-bor</Word> |
---|
102 | <Word>-replace</Word> |
---|
103 | <Word>-ireplace</Word> |
---|
104 | <Word>-creplace</Word> |
---|
105 | <Word>-and</Word> |
---|
106 | <Word>-or</Word> |
---|
107 | <Word>-is</Word> |
---|
108 | <Word>-isnot</Word> |
---|
109 | <Word>-as</Word> |
---|
110 | <Word>-lt</Word> |
---|
111 | <Word>-le</Word> |
---|
112 | <Word>-gt</Word> |
---|
113 | <Word>-ge</Word> |
---|
114 | <Word>-eq</Word> |
---|
115 | <Word>-ne</Word> |
---|
116 | <Word>-contains</Word> |
---|
117 | <Word>-notcontains</Word> |
---|
118 | <Word>-like</Word> |
---|
119 | <Word>-notlike</Word> |
---|
120 | <Word>-match</Word> |
---|
121 | <Word>-notmatch</Word> |
---|
122 | </Keywords> |
---|
123 | |
---|
124 | <Rule color="Variable"> |
---|
125 | \$[\d\w_]+ |
---|
126 | </Rule> |
---|
127 | |
---|
128 | <Rule color="Command"> |
---|
129 | [\w]+-[\w]+ |
---|
130 | </Rule> |
---|
131 | |
---|
132 | <!-- Digits --> |
---|
133 | <Rule color="NumberLiteral"> |
---|
134 | \b0[xX][0-9a-fA-F]+ # hex number |
---|
135 | | |
---|
136 | ( \b\d+(\.[0-9]+)? #number with optional floating point |
---|
137 | | \.[0-9]+ #or just starting with floating point |
---|
138 | ) |
---|
139 | ([eE][+-]?[0-9]+)? # optional exponent |
---|
140 | </Rule> |
---|
141 | |
---|
142 | <Rule color="Punctuation"> |
---|
143 | [?,.;()\[\]{}+\-/%*<>^+~!|&]+ |
---|
144 | </Rule> |
---|
145 | </RuleSet> |
---|
146 | </SyntaxDefinition> |
---|