From 276080aeec6d9fd6ef6bf9eccc3e78d4423b2672 Mon Sep 17 00:00:00 2001 From: Builder's Brewery Date: Wed, 6 Aug 2014 12:39:17 +0200 Subject: [PATCH 1/7] Added LSL language to 'lib/linguist/languages.yml' --- lib/linguist/languages.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index ecc1bed7..de8600f2 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1141,6 +1141,18 @@ LLVM: extensions: - .ll +LSL: + type: programming + lexer: LSL + aliases: + - lsl + ace_mode: lsl + extensions: + - .lsl + interpreters: + - lsl + color: '#3d9970' + Lasso: type: programming lexer: Lasso From 7bfb6ed5d768a6459f679cf2c95dc4f9324dd82a Mon Sep 17 00:00:00 2001 From: Builder's Brewery Date: Wed, 6 Aug 2014 12:42:32 +0200 Subject: [PATCH 2/7] Added LSL sample to 'samples/LSL/LSL.lsl' --- samples/LSL/LSL.lsl | 74 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 samples/LSL/LSL.lsl diff --git a/samples/LSL/LSL.lsl b/samples/LSL/LSL.lsl new file mode 100644 index 00000000..5d281b95 --- /dev/null +++ b/samples/LSL/LSL.lsl @@ -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; + } +} From 473688b109f84a002f6373f45d558e777a536345 Mon Sep 17 00:00:00 2001 From: Builder's Brewery Date: Wed, 6 Aug 2014 12:47:56 +0200 Subject: [PATCH 3/7] Added tests for LSL to 'test/test_language.rb' --- test/test_language.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_language.rb b/test/test_language.rb index 7c81ceef..25086562 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -32,6 +32,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 @@ -92,6 +93,7 @@ class TestLanguage < Test::Unit::TestCase assert_equal Language['Java'], Language.find_by_alias('java') assert_equal Language['JavaScript'], Language.find_by_alias('javascript') assert_equal Language['JavaScript'], Language.find_by_alias('js') + assert_equal Language['LSL'], Language.find_by_alias('lsl') assert_equal Language['Literate Haskell'], Language.find_by_alias('lhs') assert_equal Language['Literate Haskell'], Language.find_by_alias('literate-haskell') assert_equal Language['Objective-C'], Language.find_by_alias('objc') @@ -185,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 @@ -324,6 +327,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 @@ -336,6 +340,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 @@ -350,6 +355,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') From eff4da20f81035edc10e5c16dcdce0e5088545f5 Mon Sep 17 00:00:00 2001 From: Builder's Brewery Date: Wed, 6 Aug 2014 13:03:10 +0200 Subject: [PATCH 4/7] removed LSLalias from 'lib/linguist/languages.yml' --- lib/linguist/languages.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index de8600f2..2ccc57a9 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1144,8 +1144,6 @@ LLVM: LSL: type: programming lexer: LSL - aliases: - - lsl ace_mode: lsl extensions: - .lsl From 69ff3c79b4c920133a5361410f6dc937ae03335e Mon Sep 17 00:00:00 2001 From: Builder's Brewery Date: Wed, 6 Aug 2014 13:04:31 +0200 Subject: [PATCH 5/7] removed find_by_alias('lsl') test --- test/test_language.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_language.rb b/test/test_language.rb index 25086562..a037c050 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -93,7 +93,6 @@ class TestLanguage < Test::Unit::TestCase assert_equal Language['Java'], Language.find_by_alias('java') assert_equal Language['JavaScript'], Language.find_by_alias('javascript') assert_equal Language['JavaScript'], Language.find_by_alias('js') - assert_equal Language['LSL'], Language.find_by_alias('lsl') assert_equal Language['Literate Haskell'], Language.find_by_alias('lhs') assert_equal Language['Literate Haskell'], Language.find_by_alias('literate-haskell') assert_equal Language['Objective-C'], Language.find_by_alias('objc') From 17d4eb7a5ebad4f1361b32a4ff5e5fa4dd76938a Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Thu, 4 Sep 2014 11:51:41 -0500 Subject: [PATCH 6/7] Samples --- lib/linguist/samples.json | 128 +++++++++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 3 deletions(-) diff --git a/lib/linguist/samples.json b/lib/linguist/samples.json index ef1b399e..aa13d4b2 100644 --- a/lib/linguist/samples.json +++ b/lib/linguist/samples.json @@ -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": 654836, + "languages_total": 903, "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, @@ -72649,6 +72767,7 @@ "Haskell": 302, "Hy": 155, "IDL": 418, + "IGOR Pro": 97, "INI": 27, "Idris": 148, "Inform 7": 75, @@ -72666,6 +72785,7 @@ "Kit": 6, "Kotlin": 155, "LFE": 1711, + "LSL": 198, "Lasso": 9849, "Latte": 759, "Less": 39, @@ -72862,6 +72982,7 @@ "Haskell": 3, "Hy": 2, "IDL": 4, + "IGOR Pro": 2, "INI": 2, "Idris": 1, "Inform 7": 2, @@ -72879,6 +73000,7 @@ "Kit": 1, "Kotlin": 1, "LFE": 4, + "LSL": 1, "Lasso": 4, "Latte": 2, "Less": 1, @@ -73005,5 +73127,5 @@ "fish": 3, "wisp": 1 }, - "md5": "7a970958bd95602c130be259e8f3fc31" + "md5": "74f6109f5d8edac6b3f2bd3d65b9d210" } \ No newline at end of file From 305293d3e56a0183b047417317dd226d4e565138 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Thu, 4 Sep 2014 11:57:10 -0500 Subject: [PATCH 7/7] For the pendants --- lib/linguist/languages.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index a7c7e5ad..ad92d00a 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1202,12 +1202,6 @@ LFE: LLVM: extensions: - .ll - -LabVIEW: - type: programming - lexer: Text only - extensions: - - .lvproj LSL: type: programming @@ -1218,6 +1212,12 @@ LSL: interpreters: - lsl color: '#3d9970' + +LabVIEW: + type: programming + lexer: Text only + extensions: + - .lvproj Lasso: type: programming