Skip to content

Commit

Permalink
Merge pull request #1169 from stevencohn/1158-add-rust-language
Browse files Browse the repository at this point in the history
add rust language
  • Loading branch information
stevencohn authored Nov 16, 2023
2 parents d1c5087 + 063df32 commit 55499d7
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 264 deletions.
70 changes: 70 additions & 0 deletions OneMore/Colorizer/Languages/rust.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "Rust",
"aliases": [
"rs"
],
"rules": [
{
"pattern": "(/\\*(?:[^*]|[\\r\\n]|(?:\\*+(?:[^*/]|[\\r\\n])))*\\*+/)",
"captures": [
"Comment"
]
},
{
"pattern": "(/\\*[^\\r\\n]*)$",
"scope": "Comment",
"captures": [
"Comment"
]
},
{
"pattern": "^([^\\r\\n]*\\*/)",
"scope": "",
"captures": [
"Comment"
]
},
{
"pattern": "(//.*?)\\r?$",
"captures": [
"Comment"
]
},
{
"pattern": "('#[^\\n]*?(?<!\\\\)')",
"captures": [
"Char"
]
},
{
"pattern": "(?s)(\"[^\\n]*?(?<!\\\\)\")",
"captures": [
"String"
]
},
{
"pattern": "^\\s*(\\#\\[[^\\]]*\\])",
"captures": [
"Macro"
]
},
{
"pattern": "\\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while)\\b",
"captures": [
"Keyword"
]
},
{
"pattern": "\\b(_*[a-zA-Z][a-zA-Z0-9_]*!?)\\b",
"captures": [
"Identifier"
]
},
{
"pattern": "\\b([0-9]+(?:_[0-9]+)*|0[xX][0-9a-fA-F]+(?:_[0-9a-fA-F]+)*|0[oO][0-7]+(?:_[0-7]+)*|0[bB][01]+(?:_[01]+)*)\\b",
"captures": [
"Number"
]
}
]
}
Binary file added OneMore/Colorizer/Languages/rust.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions OneMore/Colorizer/Themes/dark-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
"name": "Keyword",
"foreground": "Blue"
},
{
"name": "Macro",
"foreground": "Purple"
},
{
"name": "MarkdownBold",
"bold": true
Expand Down
4 changes: 4 additions & 0 deletions OneMore/Colorizer/Themes/light-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
"name": "Keyword",
"foreground": "Blue"
},
{
"name": "Macro",
"foreground": "Purple"
},
{
"name": "MarkdownBold",
"bold": true
Expand Down
6 changes: 6 additions & 0 deletions OneMore/OneMore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,9 @@
<Content Include="Colorizer\Languages\registry.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Colorizer\Languages\rust.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Colorizer\Languages\sql.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -1046,6 +1049,9 @@
<None Include="Colorizer\Languages\registry.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Colorizer\Languages\rust.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Properties\Emoji\Architecture.png" />
<None Include="Colorizer\Languages\golang.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
Loading

0 comments on commit 55499d7

Please sign in to comment.