mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Merge branch 'master' into newlisp
This commit is contained in:
		| @@ -420,3 +420,5 @@ https://github.com/wmertens/sublime-nix: | ||||
| - source.nix | ||||
| https://raw.githubusercontent.com/eregon/oz-tmbundle/master/Syntaxes/Oz.tmLanguage: | ||||
| - source.oz | ||||
| https://raw.githubusercontent.com/tenbits/sublime-mask/release/Syntaxes/mask.tmLanguage: | ||||
| - source.mask | ||||
| @@ -156,6 +156,22 @@ module Linguist | ||||
|       end | ||||
|     end | ||||
|      | ||||
|     disambiguate "Common Lisp", "NewLisp" do |data| | ||||
|       if /^\s*\((defun|defactor|in-package|defpackage) /.match(data) | ||||
|         Language["Common Lisp"] | ||||
|       elsif /^\s*\(define /.match(data) | ||||
|         Language["NewLisp"] | ||||
|       end | ||||
|     end | ||||
|  | ||||
|     disambiguate "TypeScript", "XML" do |data| | ||||
|       if data.include?("<TS ") | ||||
|         Language["XML"] | ||||
|       else | ||||
|         Language["TypeScript"] | ||||
|       end | ||||
|     end | ||||
|  | ||||
|     disambiguate "Frege", "Forth", "text" do |data| | ||||
|       if /^(: |also |new-device|previous )/.match(data) | ||||
|         Language["Forth"] | ||||
| @@ -165,13 +181,5 @@ module Linguist | ||||
|         Language["text"] | ||||
|       end | ||||
|     end | ||||
|  | ||||
|     disambiguate "Common Lisp", "NewLisp" do |data| | ||||
|       if /^\s*\((defun|defactor|in-package|defpackage) /.match(data) | ||||
|         Language["Common Lisp"] | ||||
|       elsif /^\s*\(define /.match(data) | ||||
|         Language["NewLisp"] | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| end | ||||
|   | ||||
| @@ -1719,7 +1719,7 @@ Mask: | ||||
|   ace_mode: mask | ||||
|   extensions: | ||||
|   - .mask | ||||
|   tm_scope: source.scss | ||||
|   tm_scope: source.mask | ||||
|  | ||||
| Mathematica: | ||||
|   type: programming | ||||
| @@ -2333,6 +2333,7 @@ Python: | ||||
|   - BUILD | ||||
|   - SConscript | ||||
|   - SConstruct | ||||
|   - Snakefile | ||||
|   - wscript | ||||
|   interpreters: | ||||
|   - python | ||||
| @@ -3079,6 +3080,7 @@ XML: | ||||
|   - .tmSnippet | ||||
|   - .tmTheme | ||||
|   - .tml | ||||
|   - .ts | ||||
|   - .ui | ||||
|   - .urdf | ||||
|   - .vbproj | ||||
|   | ||||
							
								
								
									
										47
									
								
								samples/XML/pt_BR.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								samples/XML/pt_BR.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,47 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <!DOCTYPE TS> | ||||
| <TS version="2.0" language="pt_BR"> | ||||
| <context> | ||||
|     <name>MainWindow</name> | ||||
|     <message> | ||||
|         <location filename="../forms/mainwindow.ui" line="22"/> | ||||
|         <source>United Kingdom</source> | ||||
|         <translation>Reino Unido</translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <location filename="../forms/mainwindow.ui" line="38"/> | ||||
|         <source>God save the Queen</source> | ||||
|         <translation>Deus salve a Rainha</translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <location filename="../mainwindow.cpp" line="46"/> | ||||
|         <source>England</source> | ||||
|         <translation>Inglaterra</translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <location filename="../mainwindow.cpp" line="47"/> | ||||
|         <source>Wales</source> | ||||
|         <translation>Gales</translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <location filename="../mainwindow.cpp" line="48"/> | ||||
|         <source>Scotland</source> | ||||
|         <translation>Escócia</translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <location filename="../mainwindow.cpp" line="49"/> | ||||
|         <source>Northern Ireland</source> | ||||
|         <translation>Irlanda Norte</translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <location filename="../mainwindow.cpp" line="51"/> | ||||
|         <source>Portuguese</source> | ||||
|         <translation>Português</translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <location filename="../mainwindow.cpp" line="52"/> | ||||
|         <source>English</source> | ||||
|         <translation>Inglês</translation> | ||||
|     </message> | ||||
| </context> | ||||
| </TS> | ||||
| @@ -150,4 +150,11 @@ class TestHeuristcs < Test::Unit::TestCase | ||||
|       "LoomScript" => "LoomScript/HelloWorld.ls" | ||||
|     }) | ||||
|   end | ||||
|  | ||||
|   def test_ts_by_heuristics | ||||
|     assert_heuristics({ | ||||
|       "TypeScript" => all_fixtures("TypeScript", "*.ts"), | ||||
|       "XML" => all_fixtures("XML", "*.ts") | ||||
|     }) | ||||
|   end | ||||
| end | ||||
|   | ||||
		Reference in New Issue
	
	Block a user