Skip to content

Commit 4689cf6

Browse files
committed
Fix JSON highlighting
1 parent 30cad99 commit 4689cf6

File tree

1 file changed

+26
-14
lines changed
  • ICSharpCode.AvalonEdit/Highlighting/Resources

1 file changed

+26
-14
lines changed

ICSharpCode.AvalonEdit/Highlighting/Resources/Json.xshd

+26-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Color name="Punctuation" foreground="Black" />
1111

1212
<RuleSet name="String">
13-
<Span begin="\\" end="."/>
13+
<Span begin="\\" end="." />
1414
</RuleSet>
1515

1616
<RuleSet name="Object">
@@ -22,27 +22,28 @@
2222
<Begin>'</Begin>
2323
<End>'</End>
2424
</Span>
25-
<Span color="Punctuation" ruleSet="Expression">
25+
<Span color="Punctuation" ruleSet="Expression" multiline="true">
2626
<Begin>:</Begin>
27+
<End>(?= [,}] )</End>
2728
</Span>
28-
<Span color="Punctuation">
29-
<Begin>,</Begin>
30-
</Span>
29+
<Rule color="Punctuation">
30+
,
31+
</Rule>
3132
</RuleSet>
3233

3334
<RuleSet name="Array">
34-
<Import ruleSet="Expression"/>
35-
<Span color="Punctuation">
36-
<Begin>,</Begin>
37-
</Span>
35+
<Import ruleSet="Expression" />
36+
<Rule color="Punctuation">
37+
,
38+
</Rule>
3839
</RuleSet>
3940

4041
<RuleSet name="Expression">
41-
<Keywords color="Bool" >
42+
<Keywords color="Bool">
4243
<Word>true</Word>
4344
<Word>false</Word>
4445
</Keywords>
45-
<Keywords color="Null" >
46+
<Keywords color="Null">
4647
<Word>null</Word>
4748
</Keywords>
4849
<Span color="String" ruleSet="String">
@@ -62,11 +63,22 @@
6263
<End>\]</End>
6364
</Span>
6465
<Rule color="Number">
65-
\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?
66+
-? \b
67+
(?:
68+
0[xX][0-9a-fA-F]+
69+
|
70+
(?:
71+
72+
[0-9]+ (?: \. [0-9]+ )?
73+
|
74+
\. [0-9]+
75+
)
76+
(?: [eE] [+-]? [0-9]+ )?
77+
)
6678
</Rule>
6779
</RuleSet>
6880

6981
<RuleSet>
70-
<Import ruleSet="Expression"/>
82+
<Import ruleSet="Expression" />
7183
</RuleSet>
72-
</SyntaxDefinition>
84+
</SyntaxDefinition>

0 commit comments

Comments
 (0)