Skip to content

Commit

Permalink
Json.xshd Update AvaloniaUI#205
Browse files Browse the repository at this point in the history
icsharpcode/AvalonEdit#205 (sync xshd files)
  • Loading branch information
danwalmsley committed Nov 20, 2020
1 parent abd78eb commit 1bd3b55
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 195 deletions.
2 changes: 1 addition & 1 deletion src/AvaloniaEdit/Highlighting/Resources/ASPX.xshd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name="ASP/XHTML" extensions=".asp;.aspx;.asax;.asmx;.ascx;.master" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="ASPSectionStartEndTags" foreground="Black" background="Yellow" exampleText="&lt;% System.Console.WriteLine(&quot;Hello World!&quot;); %&gt;" />
<Color name="ASPSectionStartEndTags" foreground="Black" background="Yellow" exampleText="&lt;% System.Console.WriteLine(&quot;Hello World!&quot;); %&gt;" />
<Color name="ASPSection" foreground="Black" background="#FFF7F2E3" exampleText="&lt;% System.Console.WriteLine(&quot;Hello World!&quot;); %&gt;" />
<RuleSet ignoreCase="true">
<Span ruleSet="ASP" multiline="true">
Expand Down
2 changes: 1 addition & 1 deletion src/AvaloniaEdit/Highlighting/Resources/CSharp-Mode.xshd
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,4 @@
[?,.;()\[\]{}+\-/%*&lt;&gt;^+~!|&amp;]+
</Rule>
</RuleSet>
</SyntaxDefinition>
</SyntaxDefinition>
6 changes: 1 addition & 5 deletions src/AvaloniaEdit/Highlighting/Resources/JavaScript-Mode.xshd
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,9 @@
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<!--<Rule color="Regex">/.*/</Rule>-->
<Span color="Regex">
<Begin>/</Begin>
<Begin>(?&lt;!([})\]\w]+\s*))/</Begin>
<End>/</End>
<RuleSet>
<Span begin="\\/" end="." />
</RuleSet>
</Span>
<Span color="String" multiline="true">
<Begin>"</Begin>
Expand Down
72 changes: 72 additions & 0 deletions src/AvaloniaEdit/Highlighting/Resources/Json.xshd
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- syntaxdefinition for Json by alek kowalczyk -->
<!-- update by zuijin in 2019.12.20 -->
<SyntaxDefinition name="Json" extensions=".json" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Bool" foreground="Blue" exampleText="true | false" />
<Color name="Number" foreground="Red" exampleText="3.14" />
<Color name="String" foreground="Green" exampleText="" />
<Color name="Null" foreground="Olive" exampleText="" />
<Color name="FieldName" foreground="DarkMagenta" />
<Color name="Punctuation" foreground="Black" />

<RuleSet name="String">
<Span begin="\\" end="."/>
</RuleSet>

<RuleSet name="Object">
<Span color="FieldName" ruleSet="String">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span color="FieldName" ruleSet="String">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span color="Punctuation" ruleSet="Expression">
<Begin>:</Begin>
</Span>
<Span color="Punctuation">
<Begin>,</Begin>
</Span>
</RuleSet>

<RuleSet name="Array">
<Import ruleSet="Expression"/>
<Span color="Punctuation">
<Begin>,</Begin>
</Span>
</RuleSet>

<RuleSet name="Expression">
<Keywords color="Bool" >
<Word>true</Word>
<Word>false</Word>
</Keywords>
<Keywords color="Null" >
<Word>null</Word>
</Keywords>
<Span color="String" ruleSet="String">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span color="String" ruleSet="String">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span color="Punctuation" ruleSet="Object" multiline="true">
<Begin>\{</Begin>
<End>\}</End>
</Span>
<Span color="Punctuation" ruleSet="Array" multiline="true">
<Begin>\[</Begin>
<End>\]</End>
</Span>
<Rule color="Number">
\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?
</Rule>
</RuleSet>

<RuleSet>
<Import ruleSet="Expression"/>
</RuleSet>
</SyntaxDefinition>
148 changes: 74 additions & 74 deletions src/AvaloniaEdit/Highlighting/Resources/MarkDownWithFontSize-Mode.xshd
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
<?xml version="1.0"?>
<SyntaxDefinition name="MarkDownWithFontSize" extensions=".md" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Heading1" foreground="Maroon" fontSize="30" exampleText="# Title #" />
<Color name="Heading2" foreground="Maroon" fontSize="27" exampleText="# Title #" />
<Color name="Heading3" foreground="Maroon" fontSize="24" exampleText="# Title #" />
<Color name="Heading4" foreground="Maroon" fontSize="21" exampleText="# Title #" />
<Color name="Heading5" foreground="Maroon" fontSize="18" exampleText="# Title #" />
<Color name="Heading6" foreground="Maroon" fontSize="15" exampleText="# Title #" />
<Color name="Emphasis" fontStyle="italic" exampleText="*this* is important!" />
<Color name="StrongEmphasis" fontWeight="bold" exampleText="**this** is more important!" />
<Color name="Code" fontFamily="Footlight MT Light" exampleText="this is `int.GetHashCode()`" />
<Color name="BlockQuote" foreground="DarkBlue" exampleText="&gt; This is a\r\n&gt; quote." />
<Color name="Link" foreground="Blue" exampleText="[text](http://example.com)" />
<Color name="Image" foreground="Green" exampleText="[text][http://example.com/test.png]" />
<Color name="LineBreak" background="LightGray" exampleText="end of line \r\n2nd line " />

<RuleSet ignoreCase="true">
<Rule color="Heading1">
^[#]{1}[ ]{1}.*
</Rule>
<Rule color="Heading2">
^[#]{2}[ ]{1}.*
</Rule>
<Rule color="Heading3">
^[#]{3}[ ]{1}.*
</Rule>
<Rule color="Heading4">
^[#]{4}[ ]{1}.*
</Rule>
<Rule color="Heading5">
^[#]{5}[ ]{1}.*
</Rule>
<Rule color="Heading6">
^[#]{6}[ ]{1}.*
</Rule>
<Rule color="StrongEmphasis">
\*\*.*\*\*
</Rule>
<Rule color="StrongEmphasis">
__.*__
</Rule>
<Rule color="Emphasis">
\*(?![ ]).*\*
</Rule>
<Rule color="Emphasis">
_.*_
</Rule>
<Rule color="Code">
`.*`
</Rule>
<Span color="Code" ruleSet="C#/" multiline="true">
<Begin>^\t</Begin>
<End>^(?!\t)</End>
</Span>
<Span color="Code" ruleSet="C#/" multiline="true">
<Begin>^[ ]{4}</Begin>
<End>^(?![ ]{4})</End>
</Span>
<Span color="BlockQuote" multiline="true">
<Begin>^&gt;</Begin>
<End>^(?!&gt;)</End>
</Span>
<Rule color="Image">
\!\[.*\]\[.*\]
</Rule>
<Rule color="Link">
\[.*\]\(.*\)
</Rule>
<Rule color="Link">
\[.*\]\[.*\]
</Rule>
<Rule color="LineBreak">
[ ]{2}$
</Rule>
</RuleSet>
</SyntaxDefinition>
<Color name="Heading1" foreground="Maroon" fontSize="30" exampleText="# Title #" />
<Color name="Heading2" foreground="Maroon" fontSize="27" exampleText="# Title #" />
<Color name="Heading3" foreground="Maroon" fontSize="24" exampleText="# Title #" />
<Color name="Heading4" foreground="Maroon" fontSize="21" exampleText="# Title #" />
<Color name="Heading5" foreground="Maroon" fontSize="18" exampleText="# Title #" />
<Color name="Heading6" foreground="Maroon" fontSize="15" exampleText="# Title #" />
<Color name="Emphasis" fontStyle="italic" exampleText="*this* is important!" />
<Color name="StrongEmphasis" fontWeight="bold" exampleText="**this** is more important!" />
<Color name="Code" fontFamily="Footlight MT Light" exampleText="this is `int.GetHashCode()`" />
<Color name="BlockQuote" foreground="DarkBlue" exampleText="&gt; This is a\r\n&gt; quote." />
<Color name="Link" foreground="Blue" exampleText="[text](http://example.com)" />
<Color name="Image" foreground="Green" exampleText="[text][http://example.com/test.png]" />
<Color name="LineBreak" background="LightGray" exampleText="end of line \r\n2nd line " />
<RuleSet ignoreCase="true">
<Rule color="Heading1">
^[#]{1}[ ]{1}.*
</Rule>
<Rule color="Heading2">
^[#]{2}[ ]{1}.*
</Rule>
<Rule color="Heading3">
^[#]{3}[ ]{1}.*
</Rule>
<Rule color="Heading4">
^[#]{4}[ ]{1}.*
</Rule>
<Rule color="Heading5">
^[#]{5}[ ]{1}.*
</Rule>
<Rule color="Heading6">
^[#]{6}[ ]{1}.*
</Rule>
<Rule color="StrongEmphasis">
\*\*.*\*\*
</Rule>
<Rule color="StrongEmphasis">
__.*__
</Rule>
<Rule color="Emphasis">
\*(?![ ]).*\*
</Rule>
<Rule color="Emphasis">
_.*_
</Rule>
<Rule color="Code">
`.*`
</Rule>
<Span color="Code" ruleSet="C#/" multiline="true">
<Begin>^\t</Begin>
<End>^(?!\t)</End>
</Span>
<Span color="Code" ruleSet="C#/" multiline="true">
<Begin>^[ ]{4}</Begin>
<End>^(?![ ]{4})</End>
</Span>
<Span color="BlockQuote" multiline="true">
<Begin>^&gt;</Begin>
<End>^(?!&gt;)</End>
</Span>
<Rule color="Image">
\!\[.*\]\[.*\]
</Rule>
<Rule color="Link">
\[.*\]\(.*\)
</Rule>
<Rule color="Link">
\[.*\]\[.*\]
</Rule>
<Rule color="LineBreak">
[ ]{2}$
</Rule>
</RuleSet>
</SyntaxDefinition>
Loading

0 comments on commit 1bd3b55

Please sign in to comment.