Skip to content

Commit

Permalink
Add R and Pascal language defs (#1634)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn authored Oct 26, 2024
1 parent 514638c commit d7bc2de
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 0 deletions.
55 changes: 55 additions & 0 deletions OneMore/Colorizer/Languages/pascal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "Pascal",
"rules": [
{
"pattern": "({(?:[^}]|[\\r\\n]|(?:{+(?:[^}]|[\\r\\n])))*})",
"captures": [
"Comment"
]
},
{
"pattern": "({[^\\r\\n]*)$",
"scope": "Comment",
"captures": [
"Comment"
]
},
{
"pattern": "^([^{\\r\\n]*})\\s*$",
"scope": "",
"captures": [
"Comment"
]
},
{
"pattern": "(//.*?)\\r?$",
"captures": [
"Comment"
]
},
{
"pattern": "('[^\\n]*?(?<!\\\\)')",
"captures": [
"String"
]
},
{
"pattern": "\\b((?i:absolute|and|array|asm|begin|case|const|constructor|destructor|div|do|downto|else|end|file|for|function|goto|if|implementation|in|inherited|inline|interface|label|mod|nil|not|object|of|operator|or|packed|procedure|program|record|reintroduce|repeat|self|set|shl|shr|string|then|to|type|unit|until|uses|var|while|with|xor))\\b",
"captures": [
"Keyword"
]
},
{
"pattern": "\\b(\\w+\\()",
"captures": [
"Predefined"
]
},
{
"pattern": "\\b([0-9]{1,})\\b",
"captures": [
"Number"
]
}
]
}
Binary file added OneMore/Colorizer/Languages/pascal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions OneMore/Colorizer/Languages/r.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "R",
"aliases": [
"R"
],
"rules": [
{
"pattern": "(\\#.*?)\\r?$",
"captures": [
"Comment"
]
},
{
"pattern": "(?s)(\"[^\\n]*?(?<!\\\\)\")",
"captures": [
"String"
]
},
{
"pattern": "\\b(break|else|FALSE|for|function|if|in|Inf|NA|NA_integer_|NA_real_|NA_complex_|NA_character_|next|NULL|repeat|TRUE|while)\\b",
"captures": [
"Keyword"
]
},
{
"pattern": "\\b(\\w+\\()",
"captures": [
"Predefined"
]
},
{
"pattern": "\\b([0-9]{1,})\\b",
"captures": [
"Number"
]
}
]
}
Binary file added OneMore/Colorizer/Languages/r.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions OneMore/OneMore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,9 @@
<Content Include="Colorizer\Languages\javascript.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Colorizer\Languages\pascal.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Colorizer\Languages\php.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand All @@ -1127,6 +1130,9 @@
<Content Include="Colorizer\Languages\python.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Colorizer\Languages\r.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Colorizer\Languages\registry.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -1179,12 +1185,18 @@
<None Include="Colorizer\Languages\bash.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Colorizer\Languages\pascal.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Colorizer\Languages\php.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Colorizer\Languages\plantuml.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Colorizer\Languages\r.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Colorizer\Languages\registry.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down

0 comments on commit d7bc2de

Please sign in to comment.