From a096e3df66b5db139e7bb25d023ec5240ecf97ac Mon Sep 17 00:00:00 2001 From: Alok Menghrajani Date: Mon, 30 Jan 2012 17:42:09 -0800 Subject: [PATCH 1/2] Add detection for opa (http://www.opalang.org/). --- lib/linguist/languages.yml | 7 ++++++- test/fixtures/hello_syntax1.opa | 5 +++++ test/fixtures/hello_syntax2.opa | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/hello_syntax1.opa create mode 100644 test/fixtures/hello_syntax2.opa diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index a56545e6..655aefd4 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -342,7 +342,7 @@ Fancy: Fantom: type: programming - lexer: Java + lexer: Java extensions: - .fan @@ -691,6 +691,11 @@ Objective-J: - .j - .sj +Opa: + type: programming + extensions: + - .opa + OpenCL: type: programming group: C diff --git a/test/fixtures/hello_syntax1.opa b/test/fixtures/hello_syntax1.opa new file mode 100644 index 00000000..dcfcc4ed --- /dev/null +++ b/test/fixtures/hello_syntax1.opa @@ -0,0 +1,5 @@ +server = Server.one_page_bundle("Hello World", + [], + [], + _ ->

Hello, world

) + diff --git a/test/fixtures/hello_syntax2.opa b/test/fixtures/hello_syntax2.opa new file mode 100644 index 00000000..aea48e82 --- /dev/null +++ b/test/fixtures/hello_syntax2.opa @@ -0,0 +1,7 @@ +Server.start( + Server.http, + { + page: function() {

Hello, world

}, + title: "Hello, world" + } +) From 73efe3756846be269310205a7841f2bbf97df6f4 Mon Sep 17 00:00:00 2001 From: Alok Menghrajani Date: Wed, 1 Feb 2012 18:03:06 -0800 Subject: [PATCH 2/2] Fix test fixtures for opa and add some comments. --- test/fixtures/hello_syntax1.opa | 12 ++++++++---- test/fixtures/hello_syntax2.opa | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/fixtures/hello_syntax1.opa b/test/fixtures/hello_syntax1.opa index dcfcc4ed..88a9cc8c 100644 --- a/test/fixtures/hello_syntax1.opa +++ b/test/fixtures/hello_syntax1.opa @@ -1,5 +1,9 @@ -server = Server.one_page_bundle("Hello World", - [], - [], - _ ->

Hello, world

) +/** + * To compile & run on port 8080: + * opa hello_syntax1.opa -- + */ +server = Server.one_page_server( + "Hello, world", + -> (

Hello, world

) +) diff --git a/test/fixtures/hello_syntax2.opa b/test/fixtures/hello_syntax2.opa index aea48e82..14c0c93f 100644 --- a/test/fixtures/hello_syntax2.opa +++ b/test/fixtures/hello_syntax2.opa @@ -1,3 +1,7 @@ +/** + * To compile & run on port 8080: + * opa --parser js-like hello_syntax2.opa -- + */ Server.start( Server.http, {