mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Merge branch 'master' into perl_6
Conflicts: lib/linguist/samples.json
This commit is contained in:
		@@ -726,6 +726,12 @@ Haxe:
 | 
			
		||||
  extensions:
 | 
			
		||||
  - .hxsl
 | 
			
		||||
 | 
			
		||||
IDL:
 | 
			
		||||
  type: programming
 | 
			
		||||
  lexer: Text only
 | 
			
		||||
  color: "#e3592c"
 | 
			
		||||
  primary_extension: .pro
 | 
			
		||||
 | 
			
		||||
INI:
 | 
			
		||||
  type: data
 | 
			
		||||
  extensions:
 | 
			
		||||
@@ -1269,8 +1275,6 @@ Prolog:
 | 
			
		||||
  type: programming
 | 
			
		||||
  color: "#74283c"
 | 
			
		||||
  primary_extension: .prolog
 | 
			
		||||
  extensions:
 | 
			
		||||
  - .pro
 | 
			
		||||
 | 
			
		||||
Protocol Buffer:
 | 
			
		||||
  type: markup
 | 
			
		||||
 
 | 
			
		||||
@@ -143,6 +143,10 @@
 | 
			
		||||
      ".handlebars",
 | 
			
		||||
      ".hbs"
 | 
			
		||||
    ],
 | 
			
		||||
    "IDL": [
 | 
			
		||||
      ".dlm",
 | 
			
		||||
      ".pro"
 | 
			
		||||
    ],
 | 
			
		||||
    "Idris": [
 | 
			
		||||
      ".idr"
 | 
			
		||||
    ],
 | 
			
		||||
@@ -512,8 +516,8 @@
 | 
			
		||||
      ".gemrc"
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  "tokens_total": 432733,
 | 
			
		||||
  "languages_total": 505,
 | 
			
		||||
  "tokens_total": 433151,
 | 
			
		||||
  "languages_total": 509,
 | 
			
		||||
  "tokens": {
 | 
			
		||||
    "ABAP": {
 | 
			
		||||
      "*/**": 1,
 | 
			
		||||
@@ -17956,6 +17960,155 @@
 | 
			
		||||
      "</h2>": 1,
 | 
			
		||||
      "/each": 1
 | 
			
		||||
    },
 | 
			
		||||
    "IDL": {
 | 
			
		||||
      ";": 59,
 | 
			
		||||
      "docformat": 3,
 | 
			
		||||
      "+": 8,
 | 
			
		||||
      "Inverse": 1,
 | 
			
		||||
      "hyperbolic": 2,
 | 
			
		||||
      "cosine.": 1,
 | 
			
		||||
      "Uses": 1,
 | 
			
		||||
      "the": 7,
 | 
			
		||||
      "formula": 1,
 | 
			
		||||
      "text": 1,
 | 
			
		||||
      "{": 3,
 | 
			
		||||
      "acosh": 1,
 | 
			
		||||
      "}": 3,
 | 
			
		||||
      "(": 26,
 | 
			
		||||
      "z": 9,
 | 
			
		||||
      ")": 26,
 | 
			
		||||
      "ln": 1,
 | 
			
		||||
      "sqrt": 4,
 | 
			
		||||
      "-": 14,
 | 
			
		||||
      "Examples": 2,
 | 
			
		||||
      "The": 1,
 | 
			
		||||
      "arc": 1,
 | 
			
		||||
      "sine": 1,
 | 
			
		||||
      "function": 4,
 | 
			
		||||
      "looks": 1,
 | 
			
		||||
      "like": 2,
 | 
			
		||||
      "IDL": 5,
 | 
			
		||||
      "x": 8,
 | 
			
		||||
      "*": 2,
 | 
			
		||||
      "findgen": 1,
 | 
			
		||||
      "/": 1,
 | 
			
		||||
      "plot": 1,
 | 
			
		||||
      "mg_acosh": 2,
 | 
			
		||||
      "xstyle": 1,
 | 
			
		||||
      "This": 1,
 | 
			
		||||
      "should": 1,
 | 
			
		||||
      "look": 1,
 | 
			
		||||
      "..": 1,
 | 
			
		||||
      "image": 1,
 | 
			
		||||
      "acosh.png": 1,
 | 
			
		||||
      "Returns": 3,
 | 
			
		||||
      "float": 1,
 | 
			
		||||
      "double": 2,
 | 
			
		||||
      "complex": 2,
 | 
			
		||||
      "or": 1,
 | 
			
		||||
      "depending": 1,
 | 
			
		||||
      "on": 1,
 | 
			
		||||
      "input": 2,
 | 
			
		||||
      "Params": 3,
 | 
			
		||||
      "in": 4,
 | 
			
		||||
      "required": 4,
 | 
			
		||||
      "type": 5,
 | 
			
		||||
      "numeric": 1,
 | 
			
		||||
      "compile_opt": 3,
 | 
			
		||||
      "strictarr": 3,
 | 
			
		||||
      "return": 5,
 | 
			
		||||
      "alog": 1,
 | 
			
		||||
      "end": 5,
 | 
			
		||||
      "MODULE": 1,
 | 
			
		||||
      "mg_analysis": 1,
 | 
			
		||||
      "DESCRIPTION": 1,
 | 
			
		||||
      "Tools": 1,
 | 
			
		||||
      "for": 2,
 | 
			
		||||
      "analysis": 1,
 | 
			
		||||
      "VERSION": 1,
 | 
			
		||||
      "SOURCE": 1,
 | 
			
		||||
      "mgalloy": 1,
 | 
			
		||||
      "BUILD_DATE": 1,
 | 
			
		||||
      "January": 1,
 | 
			
		||||
      "FUNCTION": 2,
 | 
			
		||||
      "MG_ARRAY_EQUAL": 1,
 | 
			
		||||
      "KEYWORDS": 1,
 | 
			
		||||
      "MG_TOTAL": 1,
 | 
			
		||||
      "Find": 1,
 | 
			
		||||
      "greatest": 1,
 | 
			
		||||
      "common": 1,
 | 
			
		||||
      "denominator": 1,
 | 
			
		||||
      "GCD": 1,
 | 
			
		||||
      "two": 1,
 | 
			
		||||
      "positive": 2,
 | 
			
		||||
      "integers.": 1,
 | 
			
		||||
      "integer": 5,
 | 
			
		||||
      "a": 4,
 | 
			
		||||
      "first": 1,
 | 
			
		||||
      "b": 4,
 | 
			
		||||
      "second": 1,
 | 
			
		||||
      "mg_gcd": 2,
 | 
			
		||||
      "on_error": 1,
 | 
			
		||||
      "if": 5,
 | 
			
		||||
      "n_params": 1,
 | 
			
		||||
      "ne": 1,
 | 
			
		||||
      "then": 5,
 | 
			
		||||
      "message": 2,
 | 
			
		||||
      "mg_isinteger": 2,
 | 
			
		||||
      "||": 1,
 | 
			
		||||
      "begin": 2,
 | 
			
		||||
      "endif": 2,
 | 
			
		||||
      "_a": 3,
 | 
			
		||||
      "abs": 2,
 | 
			
		||||
      "_b": 3,
 | 
			
		||||
      "minArg": 5,
 | 
			
		||||
      "<": 1,
 | 
			
		||||
      "maxArg": 3,
 | 
			
		||||
      "eq": 2,
 | 
			
		||||
      "remainder": 3,
 | 
			
		||||
      "mod": 1,
 | 
			
		||||
      "Truncate": 1,
 | 
			
		||||
      "argument": 2,
 | 
			
		||||
      "towards": 1,
 | 
			
		||||
      "i.e.": 1,
 | 
			
		||||
      "takes": 1,
 | 
			
		||||
      "FLOOR": 1,
 | 
			
		||||
      "of": 4,
 | 
			
		||||
      "values": 2,
 | 
			
		||||
      "and": 1,
 | 
			
		||||
      "CEIL": 1,
 | 
			
		||||
      "negative": 1,
 | 
			
		||||
      "values.": 1,
 | 
			
		||||
      "Try": 1,
 | 
			
		||||
      "main": 2,
 | 
			
		||||
      "level": 2,
 | 
			
		||||
      "program": 2,
 | 
			
		||||
      "at": 1,
 | 
			
		||||
      "this": 1,
 | 
			
		||||
      "file.": 1,
 | 
			
		||||
      "It": 1,
 | 
			
		||||
      "does": 1,
 | 
			
		||||
      "print": 4,
 | 
			
		||||
      "mg_trunc": 3,
 | 
			
		||||
      "[": 6,
 | 
			
		||||
      "]": 6,
 | 
			
		||||
      "floor": 2,
 | 
			
		||||
      "ceil": 2,
 | 
			
		||||
      "array": 2,
 | 
			
		||||
      "same": 1,
 | 
			
		||||
      "as": 1,
 | 
			
		||||
      "float/double": 1,
 | 
			
		||||
      "containing": 1,
 | 
			
		||||
      "to": 1,
 | 
			
		||||
      "truncate": 1,
 | 
			
		||||
      "result": 3,
 | 
			
		||||
      "posInd": 3,
 | 
			
		||||
      "where": 1,
 | 
			
		||||
      "gt": 2,
 | 
			
		||||
      "nposInd": 2,
 | 
			
		||||
      "L": 1,
 | 
			
		||||
      "example": 1
 | 
			
		||||
    },
 | 
			
		||||
    "Idris": {
 | 
			
		||||
      "module": 1,
 | 
			
		||||
      "Prelude.Char": 1,
 | 
			
		||||
@@ -46136,6 +46289,7 @@
 | 
			
		||||
    "Groovy Server Pages": 91,
 | 
			
		||||
    "Haml": 4,
 | 
			
		||||
    "Handlebars": 69,
 | 
			
		||||
    "IDL": 418,
 | 
			
		||||
    "Idris": 148,
 | 
			
		||||
    "INI": 27,
 | 
			
		||||
    "Ioke": 2,
 | 
			
		||||
@@ -46272,6 +46426,7 @@
 | 
			
		||||
    "Groovy Server Pages": 4,
 | 
			
		||||
    "Haml": 1,
 | 
			
		||||
    "Handlebars": 2,
 | 
			
		||||
    "IDL": 4,
 | 
			
		||||
    "Idris": 1,
 | 
			
		||||
    "INI": 2,
 | 
			
		||||
    "Ioke": 1,
 | 
			
		||||
@@ -46367,5 +46522,5 @@
 | 
			
		||||
    "Xtend": 2,
 | 
			
		||||
    "YAML": 1
 | 
			
		||||
  },
 | 
			
		||||
  "md5": "e37c904444acb66720269bef954d910e"
 | 
			
		||||
  "md5": "6d8277fa0559fe70f116d8106ecc9053"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								samples/IDL/mg_acosh.pro
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								samples/IDL/mg_acosh.pro
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
; docformat = 'rst'
 | 
			
		||||
 | 
			
		||||
;+
 | 
			
		||||
; Inverse hyperbolic cosine. Uses the formula:
 | 
			
		||||
; 
 | 
			
		||||
; $$\text{acosh}(z) = \ln(z + \sqrt{z + 1} \sqrt{z - 1})$$
 | 
			
		||||
;
 | 
			
		||||
; :Examples:
 | 
			
		||||
;    The arc hyperbolic sine function looks like::
 | 
			
		||||
;
 | 
			
		||||
;       IDL> x = 2.5 * findgen(1000) / 999. + 1.
 | 
			
		||||
;       IDL> plot, x, mg_acosh(x), xstyle=1
 | 
			
		||||
;
 | 
			
		||||
;    This should look like:
 | 
			
		||||
;
 | 
			
		||||
;    .. image:: acosh.png
 | 
			
		||||
;
 | 
			
		||||
; :Returns:
 | 
			
		||||
;    float, double, complex, or double complex depending on the input
 | 
			
		||||
;
 | 
			
		||||
; :Params:
 | 
			
		||||
;    z : in, required, type=numeric
 | 
			
		||||
;       input
 | 
			
		||||
;-
 | 
			
		||||
function mg_acosh, z
 | 
			
		||||
  compile_opt strictarr
 | 
			
		||||
  
 | 
			
		||||
  return, alog(z + sqrt(z + 1) * sqrt(z - 1))
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										9
									
								
								samples/IDL/mg_analysis.dlm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								samples/IDL/mg_analysis.dlm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
MODULE mg_analysis
 | 
			
		||||
DESCRIPTION Tools for analysis
 | 
			
		||||
VERSION 1.0
 | 
			
		||||
SOURCE mgalloy
 | 
			
		||||
BUILD_DATE January 18, 2011
 | 
			
		||||
 | 
			
		||||
FUNCTION MG_ARRAY_EQUAL      2 2 KEYWORDS
 | 
			
		||||
FUNCTION MG_TOTAL            1 1
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										35
									
								
								samples/IDL/mg_gcd.pro
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								samples/IDL/mg_gcd.pro
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
; docformat = 'rst'
 | 
			
		||||
 | 
			
		||||
;+
 | 
			
		||||
; Find the greatest common denominator (GCD) for two positive integers.
 | 
			
		||||
; 
 | 
			
		||||
; :Returns:
 | 
			
		||||
;    integer
 | 
			
		||||
;
 | 
			
		||||
; :Params:
 | 
			
		||||
;    a : in, required, type=integer
 | 
			
		||||
;       first integer
 | 
			
		||||
;    b : in, required, type=integer
 | 
			
		||||
;       second integer
 | 
			
		||||
;-
 | 
			
		||||
function mg_gcd, a, b
 | 
			
		||||
  compile_opt strictarr
 | 
			
		||||
  on_error, 2
 | 
			
		||||
  
 | 
			
		||||
  if (n_params() ne 2) then message, 'incorrect number of arguments'
 | 
			
		||||
  if (~mg_isinteger(a) || ~mg_isinteger(b)) then begin
 | 
			
		||||
    message, 'integer arguments required'
 | 
			
		||||
  endif
 | 
			
		||||
  
 | 
			
		||||
  _a = abs(a)
 | 
			
		||||
  _b = abs(b)
 | 
			
		||||
  minArg = _a < _b
 | 
			
		||||
  maxArg = _a > _b
 | 
			
		||||
  
 | 
			
		||||
  if (minArg eq 0) then return, maxArg
 | 
			
		||||
  
 | 
			
		||||
  remainder = maxArg mod minArg
 | 
			
		||||
  if (remainder eq 0) then return, minArg
 | 
			
		||||
  
 | 
			
		||||
  return, mg_gcd(minArg, remainder)
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										42
									
								
								samples/IDL/mg_trunc.pro
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								samples/IDL/mg_trunc.pro
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
; docformat = 'rst'
 | 
			
		||||
 | 
			
		||||
;+
 | 
			
		||||
; Truncate argument towards 0.0, i.e., takes the `FLOOR` of positive values
 | 
			
		||||
; and the `CEIL` of negative values.
 | 
			
		||||
;
 | 
			
		||||
; :Examples:
 | 
			
		||||
;   Try the main-level program at the end of this file. It does::
 | 
			
		||||
;
 | 
			
		||||
;      IDL> print, mg_trunc([1.2, -1.2, 0.0])
 | 
			
		||||
;                 1          -1           0
 | 
			
		||||
;      IDL> print, floor([1.2, -1.2, 0.0])
 | 
			
		||||
;                 1          -2           0
 | 
			
		||||
;      IDL> print, ceil([1.2, -1.2, 0.0])
 | 
			
		||||
;                 2          -1           0
 | 
			
		||||
;
 | 
			
		||||
; :Returns:
 | 
			
		||||
;    array of same type as argument
 | 
			
		||||
;
 | 
			
		||||
; :Params:
 | 
			
		||||
;    x : in, required, type=float/double
 | 
			
		||||
;       array containing values to truncate
 | 
			
		||||
;-
 | 
			
		||||
function mg_trunc, x
 | 
			
		||||
  compile_opt strictarr
 | 
			
		||||
  
 | 
			
		||||
  result = ceil(x)
 | 
			
		||||
  posInd = where(x gt 0, nposInd)
 | 
			
		||||
  
 | 
			
		||||
  if (nposInd gt 0L) then begin
 | 
			
		||||
    result[posInd] = floor(x[posInd])
 | 
			
		||||
  endif
 | 
			
		||||
  
 | 
			
		||||
  return, result
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
; main-level example program
 | 
			
		||||
 | 
			
		||||
print, mg_trunc([1.2, -1.2, 0.0])
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user