Skip to content

Commit

Permalink
Add ReScript programming language (github-linguist#4975)
Browse files Browse the repository at this point in the history
* Add ReScript programming language

* Remove .resi extension from ReScript language

* Add heuristics for ReScript programming language

* Add .res extension to XML and add sample

Co-authored-by: Patrick Stapfer <[email protected]>
Co-authored-by: Colin Seymour <[email protected]>
  • Loading branch information
3 people authored Nov 5, 2020
1 parent ab675b0 commit 7c9740d
Show file tree
Hide file tree
Showing 9 changed files with 833 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,9 @@
[submodule "vendor/grammars/razor-plus"]
path = vendor/grammars/razor-plus
url = https://github.com/austincummings/razor-plus
[submodule "vendor/grammars/rescript-vscode"]
path = vendor/grammars/rescript-vscode
url = https://github.com/rescript-lang/rescript-vscode
[submodule "vendor/grammars/riot-syntax-highlight"]
path = vendor/grammars/riot-syntax-highlight
url = https://github.com/riot/syntax-highlight
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,8 @@ vendor/grammars/rascal-syntax-highlighting:
- source.rascal
vendor/grammars/razor-plus:
- text.html.cshtml
vendor/grammars/rescript-vscode:
- source.rescript
vendor/grammars/riot-syntax-highlight:
- text.html.riot
vendor/grammars/ruby-slim.tmbundle:
Expand Down
6 changes: 6 additions & 0 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ disambiguations:
pattern:
- '^\s*#(?:(?:if|ifdef|define|pragma)\s+\w|\s*include\s+<[^>]+>)'
- '^\s*template\s*<'
- extensions: ['.res']
rules:
- language: ReScript
pattern:
- '^\s*(let|module|type)\s+\w*\s+=\s+'
- '^\s*(?:include|open)\s+\w+\s*$'
- extensions: ['.rno']
rules:
- language: RUNOFF
Expand Down
13 changes: 13 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4636,6 +4636,18 @@ Raw token data:
tm_scope: none
ace_mode: text
language_id: 318
ReScript:
type: programming
color: "#ed5051"
ace_mode: rust
codemirror_mode: rust
codemirror_mime_type: text/x-rustsrc
extensions:
- ".res"
interpreters:
- ocaml
tm_scope: source.rescript
language_id: 501875647
Readline Config:
type: data
group: INI
Expand Down Expand Up @@ -6185,6 +6197,7 @@ XML:
- ".psc1"
- ".pt"
- ".rdf"
- ".res"
- ".resx"
- ".rss"
- ".sch"
Expand Down
Loading

0 comments on commit 7c9740d

Please sign in to comment.