diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 439a0e60..205ef11c 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -172,13 +172,15 @@ module Linguist end end - disambiguate "F#", "Forth", "GLSL" do |data| + disambiguate "F#", "Forth", "GLSL", "Filterscript" do |data| if /^(: |new-device)/.match(data) Language["Forth"] elsif /^\s*(#light|import|let|module|namespace|open|type)/.match(data) Language["F#"] - elsif /^\s*(#include|#pragma|precision|uniform|varying|void)/.match(data) + elsif /^\s*(#version|precision|uniform|varying|vec[234])/.match(data) Language["GLSL"] + elsif /#include|#pragma\s+(rs|version)|__attribute__/.match(data) + Language["Filterscript"] end end @@ -278,5 +280,12 @@ module Linguist end end + disambiguate "Rust", "RenderScript" do |data| + if data.include?("^(use |fn |mod |pub |macro_rules|impl|#!?\[)") + Language["Rust"] + elsif /#include|#pragma\s+(rs|version)|__attribute__/.match(data) + Language["RenderScript"] + end + end end end diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 67d6be1a..84b95819 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -938,6 +938,14 @@ Fantom: tm_scope: source.fan ace_mode: text +Filterscript: + type: programming + group: RenderScript + extensions: + - .fs + tm_scope: none + ace_mode: text + Formatted: type: data extensions: @@ -2677,6 +2685,14 @@ Redcode: tm_scope: none ace_mode: text +RenderScript: + type: programming + extensions: + - .rs + - .rsh + tm_scope: none + ace_mode: text + RobotFramework: type: programming extensions: