Compare commits

..

19 Commits

Author SHA1 Message Date
Arfon Smith
62b1816297 3.1.4 2014-09-05 10:40:37 -05:00
Arfon Smith
2d1e1d4747 Merge pull request #1503 from github/prolog-pl-samples
Prolog pl samples
2014-09-04 16:10:39 -05:00
Arfon Smith
f785aa0ae2 Merge branch 'master' into prolog-pl-samples
Conflicts:
	lib/linguist/languages.yml
	lib/linguist/samples.json
2014-09-04 15:51:30 -05:00
Arfon Smith
cc476e212e Another sample file
Conflicts:
	lib/linguist/samples.json
2014-09-04 15:48:38 -05:00
Arfon Smith
bca9716fc6 Another sample file 2014-09-04 13:53:36 -05:00
Arfon Smith
fae6dbfebd Taking Heuristics for a spin. 2014-09-04 13:49:30 -05:00
Arfon Smith
a7a0800b46 Merge pull request #1502 from github/1444-local
1444 local
2014-09-04 12:09:22 -05:00
Arfon Smith
305293d3e5 For the pendants 2014-09-04 11:57:10 -05:00
Arfon Smith
17d4eb7a5e Samples 2014-09-04 11:51:41 -05:00
Arfon Smith
f97e103b6d Merge branch 'master' into 1444-local 2014-09-04 11:51:06 -05:00
Brandon Keepers
dafca264b2 Merge pull request #1376 from t-b/add-igor-pro
Add highlighting for Igor Pro procedures
2014-09-03 11:12:46 -04:00
Brandon Keepers
be970e9e3d Merge pull request #1499 from pchaigno/emacs-lisp-lexer
Change lexer for Emacs Lisp from Scheme to Common Lisp
2014-09-03 10:27:16 -04:00
Paul Chaignon
e76837fa20 Change lexer for Emacs Lisp from Scheme to Common Lisp 2014-09-02 10:33:53 -04:00
Thomas Braun
bc01f8b25f Add highlighting for Igor Pro procedures
Available in pygments since 5ceb7533e214.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
2014-08-19 17:16:02 +02:00
Builder's Brewery
69ff3c79b4 removed find_by_alias('lsl') test 2014-08-06 13:04:31 +02:00
Builder's Brewery
eff4da20f8 removed LSLalias from 'lib/linguist/languages.yml' 2014-08-06 13:03:10 +02:00
Builder's Brewery
473688b109 Added tests for LSL to 'test/test_language.rb' 2014-08-06 12:47:56 +02:00
Builder's Brewery
7bfb6ed5d7 Added LSL sample to 'samples/LSL/LSL.lsl' 2014-08-06 12:42:32 +02:00
Builder's Brewery
276080aeec Added LSL language to 'lib/linguist/languages.yml' 2014-08-06 12:39:17 +02:00
11 changed files with 1753 additions and 92 deletions

View File

@@ -1,7 +1,7 @@
module Linguist
# A collection of simple heuristics that can be used to better analyze languages.
class Heuristics
ACTIVE = false
ACTIVE = true
# Public: Given an array of String language names,
# apply heuristics against the given data and return an array
@@ -13,24 +13,13 @@ module Linguist
# Returns an array of Languages or []
def self.find_by_heuristics(data, languages)
if active?
if languages.all? { |l| ["Objective-C", "C++"].include?(l) }
disambiguate_c(data, languages)
end
if languages.all? { |l| ["Perl", "Prolog"].include?(l) }
disambiguate_pl(data, languages)
result = disambiguate_pl(data, languages)
end
if languages.all? { |l| ["ECL", "Prolog"].include?(l) }
disambiguate_ecl(data, languages)
end
if languages.all? { |l| ["TypeScript", "XML"].include?(l) }
disambiguate_ts(data, languages)
end
if languages.all? { |l| ["Common Lisp", "OpenCL"].include?(l) }
disambiguate_cl(data, languages)
end
if languages.all? { |l| ["Rebol", "R"].include?(l) }
disambiguate_r(data, languages)
result = disambiguate_ecl(data, languages)
end
return result
end
end

View File

@@ -136,7 +136,7 @@ module Linguist
elsif (determined = Heuristics.find_by_heuristics(data, possible_language_names)) && !determined.empty?
determined.first
# Lastly, fall back to the probablistic classifier.
elsif classified = Classifier.classify(Samples::DATA, data, possible_language_names ).first
elsif classified = Classifier.classify(Samples::DATA, data, possible_language_names).first
# Return the actual Language object based of the string language name (i.e., first element of `#classify`)
Language[classified[0]]
end

View File

@@ -647,7 +647,7 @@ Elm:
Emacs Lisp:
type: programming
lexer: Scheme
lexer: Common Lisp
color: "#c065db"
aliases:
- elisp
@@ -1001,6 +1001,12 @@ IDL:
- .pro
- .dlm
IGOR Pro:
type: programming
lexer: Igor
extensions:
- .ipf
INI:
type: data
extensions:
@@ -1197,6 +1203,16 @@ LLVM:
extensions:
- .ll
LSL:
type: programming
lexer: LSL
ace_mode: lsl
extensions:
- .lsl
interpreters:
- lsl
color: '#3d9970'
LabVIEW:
type: programming
lexer: Text only
@@ -1778,9 +1794,9 @@ Prolog:
type: programming
color: "#74283c"
extensions:
- .prolog
- .ecl
- .pl
- .ecl
- .prolog
Propeller Spin:
type: programming

View File

@@ -254,6 +254,9 @@
".dlm",
".pro"
],
"IGOR Pro": [
".ipf"
],
"Idris": [
".idr"
],
@@ -308,6 +311,9 @@
"LFE": [
".lfe"
],
"LSL": [
".lsl"
],
"Lasso": [
".las",
".lasso",
@@ -845,8 +851,8 @@
"exception.zep.php"
]
},
"tokens_total": 654541,
"languages_total": 900,
"tokens_total": 659332,
"languages_total": 905,
"tokens": {
"ABAP": {
"*/**": 1,
@@ -28185,6 +28191,52 @@
"L": 1,
"example": 1
},
"IGOR Pro": {
"#pragma": 2,
"rtGlobals": 2,
"Function": 6,
"FooBar": 1,
"(": 10,
")": 10,
"return": 7,
"End": 7,
"FooBarSubType": 1,
"ButtonControl": 1,
"Function/D": 1,
"FooBarVar": 1,
"static": 3,
"FooBarStatic": 1,
"threadsafe": 2,
"FooBarStaticThreadsafe": 1,
"FooBarThread": 1,
"CallOperationsAndBuiltInFuncs": 1,
"string": 4,
"var": 3,
"someDQString": 2,
"Make/N": 1,
"myWave": 2,
"Redimension/N": 1,
"-": 3,
"print": 1,
"strlen": 1,
"StrConstant": 1,
"myConstString": 1,
"constant": 1,
"myConst": 1,
"Structure": 2,
"struct1": 1,
"str": 2,
"variable": 2,
"EndStructure": 2,
"struct2": 1,
"#include": 1,
"#ifdef": 1,
"NOT_DEFINED": 1,
"//": 1,
"conditional": 1,
"compilation": 1,
"#endif": 1
},
"INI": {
";": 1,
"editorconfig.org": 1,
@@ -35990,6 +36042,72 @@
"info": 1,
"reproduce": 1
},
"LSL": {
"integer": 8,
"someIntNormal": 2,
";": 29,
"someIntHex": 2,
"someIntMath": 2,
"PI_BY_TWO": 2,
"event": 2,
"//": 5,
"is": 3,
"invalid.illegal": 2,
"key": 3,
"someKeyTexture": 2,
"TEXTURE_DEFAULT": 2,
"string": 5,
"someStringSpecial": 2,
"EOF": 2,
"some_user_defined_function_without_return_type": 2,
"(": 19,
"inputAsString": 2,
")": 19,
"{": 9,
"llSay": 1,
"PUBLIC_CHANNEL": 4,
"}": 9,
"user_defined_function_returning_a_string": 2,
"inputAsKey": 2,
"return": 1,
"default": 2,
"state_entry": 2,
"someKey": 3,
"NULL_KEY": 1,
"llGetOwner": 1,
"someString": 2,
"touch_start": 1,
"num_detected": 2,
"list": 1,
"agentsInRegion": 3,
"llGetAgentList": 1,
"AGENT_LIST_REGION": 1,
"[": 1,
"]": 1,
"numOfAgents": 2,
"llGetListLength": 1,
"index": 4,
"defaults": 1,
"to": 1,
"for": 2,
"<": 1,
"-": 1,
"+": 2,
"each": 1,
"agent": 1,
"in": 1,
"region": 1,
"llRegionSayTo": 1,
"llList2Key": 1,
"touch_end": 1,
"llSetInventoryPermMask": 1,
"MASK_NEXT": 1,
"PERM_ALL": 1,
"reserved.godmode": 1,
"llWhisper": 2,
"state": 3,
"other": 2
},
"Lasso": {
"<": 7,
"LassoScript": 1,
@@ -55878,54 +55996,441 @@
"TWO_PI": 1
},
"Prolog": {
"-": 161,
"module": 3,
"(": 327,
"-": 350,
"module": 4,
"(": 1161,
"cpa_admin": 1,
"[": 290,
"change_password_form//1": 1,
"]": 288,
")": 1158,
".": 232,
"use_module": 20,
"user": 45,
"user_db": 1,
"library": 19,
"http/http_parameters": 1,
"http/http_session": 1,
"http/html_write": 1,
"http/html_head": 1,
"http/mimetype": 1,
"http/http_dispatch": 1,
"url": 1,
"debug": 5,
"lists": 1,
"option": 8,
"http_settings": 1,
"http_handler": 20,
"cliopatria": 38,
"list_users": 13,
"create_admin": 3,
"add_user_form": 4,
"add_openid_server_form": 4,
"add_user": 6,
"self_register": 4,
"add_openid_server": 3,
"edit_user_form": 7,
"edit_user": 4,
"del_user": 5,
"edit_openid_server_form": 6,
"edit_openid_server": 4,
"del_openid_server": 4,
"change_password_form": 7,
"change_password": 5,
"login_form": 4,
"user_login": 4,
"user_logout": 4,
"settings": 4,
"save_settings": 3,
"%": 194,
"+": 47,
"Request": 46,
"HTTP": 4,
"Handler": 1,
"listing": 1,
"registered": 3,
"users.": 2,
"_Request": 11,
"authorized": 13,
"admin": 31,
"if_allowed": 4,
"edit": 15,
"true": 32,
"UserOptions": 5,
"openid": 5,
"OpenIDOptions": 2,
"reply_html_page": 15,
"default": 16,
"title": 13,
"h1": 15,
"user_table": 3,
"p": 11,
"action": 18,
"location_by_id": 13,
"openid_server_table": 4,
"Token": 2,
"Options": 43,
"logged_on": 4,
"User": 77,
"anonymous": 2,
"catch": 2,
"check_permission": 1,
"_": 62,
"fail": 3,
"//": 7,
"HTML": 4,
"component": 3,
"generating": 1,
"a": 25,
"table": 9,
"of": 10,
"{": 22,
"setof": 3,
"U": 2,
"current_user": 6,
"Users": 2,
"}": 22,
"html": 25,
"class": 14,
"block": 2,
"tr": 16,
"th": 12,
"|": 44,
"T": 4,
"user_property": 8,
"realname": 18,
"Name": 19,
"findall": 1,
"Idle": 6,
"Login": 9,
"connection": 1,
"Pairs0": 2,
"keysort": 1,
"Pairs": 4,
"OnLine": 4,
";": 37,
"length": 9,
"N": 7,
"online": 3,
"td": 20,
"on_since": 3,
"idle": 3,
"edit_user_button": 3,
"href": 6,
"encode": 4,
"_Idle": 1,
"_Connections": 2,
"format_time": 1,
"string": 10,
"Date": 2,
"_Login": 1,
"mmss_duration": 2,
"String": 10,
"Time": 3,
"in": 1,
"seconds": 1,
"Secs": 4,
"is": 24,
"round": 1,
"Hour": 2,
"Min": 4,
"mod": 2,
"Sec": 2,
"format": 9,
"Create": 2,
"the": 14,
"administrator": 1,
"login.": 2,
"throw": 12,
"error": 13,
"permission_error": 4,
"create": 3,
"context": 3,
"align": 16,
"center": 6,
"new_user_form": 3,
"real_name": 2,
"Form": 3,
"to": 19,
"register": 3,
"user.": 2,
"value": 11,
"PermUser": 3,
"form": 14,
"method": 6,
"input": 25,
"pwd1": 5,
"type": 16,
"password": 21,
"pwd2": 5,
"permissions": 5,
"buttons": 5,
"colspan": 6,
"right": 11,
"submit": 6,
"Label": 10,
"name": 8,
"size": 5,
"Only": 1,
"provide": 1,
"field": 4,
"if": 4,
"this": 1,
"not": 1,
"already": 2,
"given.": 1,
"This": 2,
"because": 1,
"firefox": 1,
"determines": 1,
"login": 3,
"from": 3,
"text": 6,
"immediately": 1,
"above": 1,
"entry.": 1,
"Other": 1,
"browsers": 1,
"may": 1,
"do": 1,
"it": 1,
"different": 1,
"so": 1,
"only": 2,
"having": 1,
"one": 1,
"probably": 1,
"savest": 1,
"solution.": 1,
"RealName": 13,
"hidden": 7,
"_Options": 1,
"API": 1,
"new": 6,
"The": 3,
"current": 3,
"must": 3,
"have": 1,
"administrative": 2,
"rights": 2,
"or": 3,
"database": 1,
"be": 6,
"empty.": 1,
"FirstUser": 2,
"http_parameters": 10,
"Password": 13,
"Retype": 4,
"read": 13,
"Read": 12,
"write": 11,
"Write": 12,
"Admin": 12,
"attribute_declarations": 10,
"attribute_decl": 21,
"password_mismatch": 2,
"password_hash": 3,
"Hash": 6,
"phrase": 6,
"allow": 17,
"Allow": 11,
"user_add": 3,
"reply_login": 5,
"Self": 1,
"and": 6,
"enable_self_register": 3,
"set": 2,
"true.": 1,
"limited": 1,
"annotate": 2,
"access.": 1,
"Returns": 1,
"forbidden": 3,
"false": 5,
"exists": 1,
"http_location_by_id": 1,
"MyUrl": 3,
"setting": 1,
"http_reply": 3,
"properties": 3,
"User.": 1,
"b": 6,
"i": 1,
"Term": 16,
"..": 11,
"Value": 15,
"O2": 6,
"p_name": 2,
"permission_checkbox": 4,
"Actions": 3,
"openid_server_property": 3,
"pterm": 5,
"Action": 17,
"memberchk": 4,
"Opts": 4,
"checked": 2,
"def_user_permissions": 3,
"DefPermissions": 2,
"checkbox": 1,
"Handle": 3,
"reply": 3,
"form.": 2,
"optional": 6,
"description": 18,
"modify_user": 2,
"modify_permissions": 2,
"Property": 6,
"_Name": 2,
"var": 7,
"set_user_property": 3,
"Access": 2,
"on": 2,
"_Access": 1,
"off": 5,
"_Repositiory": 2,
"_Action": 3,
"Delete": 2,
"delete": 2,
"user_del": 1,
"change": 2,
"context_error": 2,
"not_logged_in": 2,
"UserID": 1,
"that": 2,
"shows": 1,
"for": 4,
"changing": 1,
"UserID.": 1,
"id": 3,
"user_or_old": 3,
"pwd0": 2,
"handler": 2,
"password.": 1,
"logged": 1,
"on.": 1,
"New": 3,
"existence_error": 1,
"validate_password": 2,
"presents": 1,
"If": 2,
"there": 1,
"parameter": 2,
"return_to": 3,
"openid.return_to": 1,
"using": 1,
"redirect": 1,
"given": 2,
"URL.": 1,
"Otherwise": 1,
"display": 1,
"welcome": 1,
"page.": 1,
"ReturnTo": 6,
"Extra": 3,
"moved_temporary": 1,
"Logout": 1,
"logout": 1,
"Param": 1,
"DeclObtions": 1,
"semidet.": 4,
"Provide": 1,
"reusable": 1,
"declarations": 1,
"calls": 2,
"http_parameters/3.": 1,
"openid_server": 9,
"bool": 4,
"Def": 2,
"oneof": 1,
"Return": 1,
"an": 3,
"page": 1,
"add": 2,
"OpenID": 4,
"server.": 1,
"new_openid_form": 2,
"new_openid_form//": 1,
"det.": 5,
"Present": 1,
"provider.": 1,
"openid_description": 1,
"code": 2,
"canonical_url": 1,
"URL0": 2,
"URL": 4,
"parse_url": 2,
"Parts": 2,
"Server": 30,
"openid_property": 2,
"List": 1,
"servers": 1,
"S": 2,
"openid_current_server": 1,
"Servers": 2,
"openid_list_servers": 4,
"H": 2,
"openid_list_server": 2,
"openid_field": 3,
"edit_openid_button": 3,
"Field": 2,
"server": 1,
"Description": 2,
"modify_openid": 2,
"openid_modify_permissions": 2,
"openid_set_property": 2,
"openid_del_server": 1,
"Show": 1,
"settings.": 3,
"has": 1,
"editing": 1,
"edit_settings": 2,
"Edit": 4,
"http_show_settings": 1,
"hide_module": 1,
"warn_no_edit": 3,
"settings_no_edit": 1,
"Save": 1,
"modified": 1,
"http_apply_settings": 1,
"save": 1,
"with": 3,
"br": 1,
"subset": 2,
"Set": 4,
"Subset": 6,
"append": 3,
"L1": 1,
"powerset": 1,
"bagof": 1,
"format_spec": 12,
"[": 87,
"format_error/2": 1,
"format_spec/2": 1,
"format_spec//1": 1,
"spec_arity/2": 1,
"spec_types/2": 1,
"]": 87,
")": 326,
".": 107,
"use_module": 8,
"library": 8,
"dcg/basics": 1,
"eos//0": 1,
"integer//1": 1,
"string_without//2": 1,
"error": 6,
"when": 3,
"when/2": 1,
"%": 71,
"mavis": 1,
"format_error": 8,
"+": 14,
"Goal": 29,
"Error": 25,
"string": 8,
"is": 12,
"nondet.": 1,
"format": 8,
"Format": 23,
"Args": 19,
"format_error_": 5,
"_": 30,
"debug": 4,
"Spec": 10,
"is_list": 1,
"spec_types": 8,
"Types": 16,
"types_error": 3,
"length": 4,
"TypesLen": 3,
"ArgsLen": 3,
"types_error_": 4,
"Arg": 6,
"|": 25,
"Type": 3,
"ground": 5,
"is_of_type": 2,
@@ -55940,13 +56445,9 @@
"format_fail/3.": 1,
"prolog_walk_code": 1,
"module_class": 1,
"user": 5,
"infer_meta_predicates": 1,
"false": 2,
"autoload": 1,
"format/": 1,
"{": 7,
"}": 7,
"are": 3,
"always": 1,
"loaded": 1,
@@ -55967,7 +56468,6 @@
"checker.": 1,
"succeed": 2,
"even": 1,
"if": 1,
"no": 1,
"found": 1,
"Module": 4,
@@ -55975,12 +56475,10 @@
"predicate_property": 1,
"imported_from": 1,
"Source": 2,
"memberchk": 2,
"system": 1,
"prolog_debug": 1,
"can_check": 2,
"assert": 2,
"to": 5,
"avoid": 1,
"printing": 1,
"goals": 1,
@@ -55989,32 +56487,22 @@
"prolog": 2,
"message": 1,
"message_location": 1,
"//": 1,
"eos.": 1,
"escape": 2,
"Numeric": 4,
"Modifier": 2,
"Action": 15,
"Rest": 12,
"numeric_argument": 5,
"modifier_argument": 3,
"action": 6,
"text": 4,
"String": 6,
";": 12,
"Codes": 21,
"string_codes": 4,
"string_without": 1,
"list": 4,
"semidet.": 3,
"text_codes": 6,
"phrase": 3,
"spec_arity": 2,
"FormatSpec": 2,
"Arity": 3,
"positive_integer": 1,
"det.": 4,
"type": 2,
"Item": 2,
"Items": 2,
"item_types": 3,
@@ -56029,17 +56517,14 @@
"Text": 1,
"codes": 5,
"Var": 5,
"var": 4,
"Atom": 3,
"atom": 6,
"N": 5,
"integer": 7,
"C": 5,
"colon": 1,
"no_colon": 1,
"is_action": 4,
"multi.": 1,
"a": 4,
"d": 3,
"e": 1,
"float": 3,
@@ -56047,7 +56532,6 @@
"G": 2,
"I": 1,
"n": 1,
"p": 1,
"any": 3,
"r": 1,
"s": 2,
@@ -56056,7 +56540,6 @@
"func": 13,
"op": 2,
"xfy": 2,
"of": 8,
"/2": 3,
"list_util": 1,
"xfy_list/3": 1,
@@ -56070,7 +56553,6 @@
"at": 3,
"compile": 3,
"time": 3,
"for": 1,
"macro": 1,
"expansion.": 1,
"compile_function/4.": 1,
@@ -56081,19 +56563,14 @@
"evaluable/1": 1,
"throws": 1,
"exception": 1,
"with": 2,
"strings": 1,
"evaluable": 1,
"term_variables": 1,
"F": 26,
"function_composition_term": 2,
"Functor": 8,
"true": 5,
"..": 6,
"format_template": 7,
"has_type": 2,
"fail": 1,
"be": 4,
"explicit": 1,
"Dict": 3,
"is_dict": 1,
@@ -56101,7 +56578,6 @@
"Function": 5,
"Argument": 1,
"Apply": 1,
"an": 1,
"Argument.": 1,
"A": 1,
"predicate": 4,
@@ -56110,18 +56586,15 @@
"argument": 2,
"generates": 1,
"output": 1,
"and": 2,
"penultimate": 1,
"accepts": 1,
"input.": 1,
"This": 1,
"realized": 1,
"by": 2,
"expanding": 1,
"function": 2,
"application": 2,
"chained": 1,
"calls": 1,
"time.": 1,
"itself": 1,
"can": 3,
@@ -56130,12 +56603,8 @@
"reverse": 4,
"sort": 2,
"c": 2,
"b": 4,
"meta_predicate": 2,
"throw": 1,
"permission_error": 1,
"call": 4,
"context": 1,
"X": 10,
"Y": 7,
"defer": 1,
@@ -56143,13 +56612,10 @@
"run": 1,
"P": 2,
"Creates": 1,
"new": 2,
"composing": 1,
"G.": 1,
"The": 1,
"functions": 2,
"composed": 1,
"create": 1,
"compiled": 1,
"which": 1,
"behaves": 1,
@@ -56164,7 +56630,6 @@
"syntax": 1,
"highlighting": 1,
"functions_to_compose": 2,
"Term": 10,
"Funcs": 7,
"functor": 1,
"Op": 3,
@@ -56173,7 +56638,6 @@
"Goals": 2,
"Tmp": 3,
"instantiation_error": 1,
"append": 2,
"NewArgs": 2,
"variant_sha1": 1,
"Sha": 2,
@@ -56186,9 +56650,7 @@
"compile_predicates": 1,
"Output": 2,
"compound": 1,
"setof": 1,
"arg": 1,
"Name": 2,
"Args0": 2,
"nth1": 2,
"lib": 1,
@@ -56199,11 +56661,9 @@
"#": 9,
"labeling": 2,
"vabsIC": 1,
"or": 1,
"faitListe": 3,
"First": 2,
"Taille": 2,
"Min": 2,
"Max": 2,
"Min..Max": 1,
"Taille1": 2,
@@ -56258,7 +56718,6 @@
"Rs1": 2,
"left": 4,
"stay": 1,
"right": 1,
"L": 2
},
"Propeller Spin": {
@@ -72649,6 +73108,7 @@
"Haskell": 302,
"Hy": 155,
"IDL": 418,
"IGOR Pro": 97,
"INI": 27,
"Idris": 148,
"Inform 7": 75,
@@ -72666,6 +73126,7 @@
"Kit": 6,
"Kotlin": 155,
"LFE": 1711,
"LSL": 198,
"Lasso": 9849,
"Latte": 759,
"Less": 39,
@@ -72725,7 +73186,7 @@
"PostScript": 107,
"PowerShell": 12,
"Processing": 74,
"Prolog": 2420,
"Prolog": 6916,
"Propeller Spin": 13519,
"Protocol Buffer": 63,
"PureScript": 1652,
@@ -72862,6 +73323,7 @@
"Haskell": 3,
"Hy": 2,
"IDL": 4,
"IGOR Pro": 2,
"INI": 2,
"Idris": 1,
"Inform 7": 2,
@@ -72879,6 +73341,7 @@
"Kit": 1,
"Kotlin": 1,
"LFE": 4,
"LSL": 1,
"Lasso": 4,
"Latte": 2,
"Less": 1,
@@ -72938,7 +73401,7 @@
"PostScript": 1,
"PowerShell": 2,
"Processing": 1,
"Prolog": 5,
"Prolog": 7,
"Propeller Spin": 10,
"Protocol Buffer": 1,
"PureScript": 4,
@@ -73005,5 +73468,5 @@
"fish": 3,
"wisp": 1
},
"md5": "7a970958bd95602c130be259e8f3fc31"
"md5": "3778b7ad7414915c83e6960531006542"
}

View File

@@ -1,3 +1,3 @@
module Linguist
VERSION = "3.1.2"
VERSION = "3.1.4"
end

View File

@@ -0,0 +1,38 @@
#pragma rtGlobals=3
Function FooBar()
return 0
End
Function FooBarSubType() : ButtonControl
return 0
End
Function/D FooBarVar()
return 0
End
static Function FooBarStatic()
return 0
End
threadsafe static Function FooBarStaticThreadsafe()
return 0
End
threadsafe Function FooBarThread()
return 0
End
Function CallOperationsAndBuiltInFuncs(string var)
string someDQString = "abcd"
Make/N=(1,2,3,4) myWave
Redimension/N=(-1,-1,-1,5) myWave
print strlen(someDQString)
return 0
End

View File

@@ -0,0 +1,21 @@
#pragma rtGlobals=3
StrConstant myConstString="abcd"
// some comment
constant myConst=123
Structure struct1
string str
variable var
EndStructure
static Structure struct2
string str
variable var
EndStructure
#include "someFile"
#ifdef NOT_DEFINED
// conditional compilation
#endif

74
samples/LSL/LSL.lsl Normal file
View File

@@ -0,0 +1,74 @@
/*
Testing syntax highlighting
for the Linden Scripting Language
*/
integer someIntNormal = 3672;
integer someIntHex = 0x00000000;
integer someIntMath = PI_BY_TWO;
integer event = 5673;// 'event' is invalid.illegal
key someKeyTexture = TEXTURE_DEFAULT;
string someStringSpecial = EOF;
some_user_defined_function_without_return_type(string inputAsString)
{
llSay(PUBLIC_CHANNEL, inputAsString);
}
string user_defined_function_returning_a_string(key inputAsKey)
{
return (string)inputAsKey;
}
default
{
state_entry()
{
key someKey = NULL_KEY;
someKey = llGetOwner();
string someString = user_defined_function_returning_a_string(someKey);
some_user_defined_function_without_return_type(someString);
}
touch_start(integer num_detected)
{
list agentsInRegion = llGetAgentList(AGENT_LIST_REGION, []);
integer numOfAgents = llGetListLength(agentsInRegion);
integer index; // defaults to 0
for (; index <= numOfAgents - 1; index++) // for each agent in region
{
llRegionSayTo(llList2Key(agentsInRegion, index), PUBLIC_CHANNEL, "Hello, Avatar!");
}
}
touch_end(integer num_detected)
{
someIntNormal = 3672;
someIntHex = 0x00000000;
someIntMath = PI_BY_TWO;
event = 5673;// 'event' is invalid.illegal
someKeyTexture = TEXTURE_DEFAULT;
someStringSpecial = EOF;
llSetInventoryPermMask("some item", MASK_NEXT, PERM_ALL);// 'llSetInventoryPermMask' is reserved.godmode
llWhisper(PUBLIC_CHANNEL, "Leaving \"default\" now...");
state other;
}
}
state other
{
state_entry()
{
llWhisper(PUBLIC_CHANNEL, "Entered \"state other\", returning to \"default\" again...");
state default;
}
}

1051
samples/Prolog/admin.pl Executable file

File diff suppressed because it is too large Load Diff

5
samples/Prolog/ex6.pl Normal file
View File

@@ -0,0 +1,5 @@
%6.8
subset(Set, Subset) :-
append(L1, Subset, Set).
powerset(Set, Subset) :-
bagof(Subset, subset(Set, Subset), Subset).

View File

@@ -33,6 +33,7 @@ class TestLanguage < Test::Unit::TestCase
assert_equal Lexer['Java'], Language['ChucK'].lexer
assert_equal Lexer['Java'], Language['Java'].lexer
assert_equal Lexer['JavaScript'], Language['JavaScript'].lexer
assert_equal Lexer['LSL'], Language['LSL'].lexer
assert_equal Lexer['MOOCode'], Language['Moocode'].lexer
assert_equal Lexer['MuPAD'], Language['mupad'].lexer
assert_equal Lexer['NASM'], Language['Assembly'].lexer
@@ -46,7 +47,6 @@ class TestLanguage < Test::Unit::TestCase
assert_equal Lexer['Ruby'], Language['Mirah'].lexer
assert_equal Lexer['Ruby'], Language['Ruby'].lexer
assert_equal Lexer['S'], Language['R'].lexer
assert_equal Lexer['Scheme'], Language['Emacs Lisp'].lexer
assert_equal Lexer['Scheme'], Language['Nu'].lexer
assert_equal Lexer['Racket'], Language['Racket'].lexer
assert_equal Lexer['Scheme'], Language['Scheme'].lexer
@@ -187,6 +187,7 @@ class TestLanguage < Test::Unit::TestCase
def test_programming
assert_equal :programming, Language['JavaScript'].type
assert_equal :programming, Language['LSL'].type
assert_equal :programming, Language['Perl'].type
assert_equal :programming, Language['PowerShell'].type
assert_equal :programming, Language['Python'].type
@@ -327,6 +328,7 @@ class TestLanguage < Test::Unit::TestCase
assert_equal '#3581ba', Language['Python'].color
assert_equal '#f1e05a', Language['JavaScript'].color
assert_equal '#31859c', Language['TypeScript'].color
assert_equal '#3d9970', Language['LSL'].color
end
def test_colors
@@ -339,6 +341,7 @@ class TestLanguage < Test::Unit::TestCase
assert_equal 'coffee', Language['CoffeeScript'].ace_mode
assert_equal 'csharp', Language['C#'].ace_mode
assert_equal 'css', Language['CSS'].ace_mode
assert_equal 'lsl', Language['LSL'].ace_mode
assert_equal 'javascript', Language['JavaScript'].ace_mode
end
@@ -353,6 +356,7 @@ class TestLanguage < Test::Unit::TestCase
end
def test_extensions
assert Language['LSL'].extensions.include?('.lsl')
assert Language['Perl'].extensions.include?('.pl')
assert Language['Python'].extensions.include?('.py')
assert Language['Ruby'].extensions.include?('.rb')