diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index cb7033de..d3dffa66 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -643,16 +643,30 @@ PHP: - .phpt Parrot Internal Representation: + type: programming lexer: Text only search_term: pir aliases: - pir primary_extension: .pir extensions: - - .pasm - - .pbc - .pir +Parrot Assembly: + type: programming + lexer: Text only + search_term: pasm + primary_extension: .pasm + extensions: + - .pasm + +Parrot Bytecode: + type: data + search_term: pbc + primary_extension: .pbc + extensions: + - .pbc + Perl: type: programming overrides: diff --git a/test/fixtures/hello.pasm b/test/fixtures/hello.pasm new file mode 100644 index 00000000..6f2efaac --- /dev/null +++ b/test/fixtures/hello.pasm @@ -0,0 +1,5 @@ +#!/usr/bin/env parrot + +.pcc_sub :main main: + say "Hello!" + end diff --git a/test/fixtures/hello.pbc b/test/fixtures/hello.pbc new file mode 100644 index 00000000..b30393e1 Binary files /dev/null and b/test/fixtures/hello.pbc differ diff --git a/test/fixtures/hello.pir b/test/fixtures/hello.pir new file mode 100644 index 00000000..6cb35c1f --- /dev/null +++ b/test/fixtures/hello.pir @@ -0,0 +1,5 @@ +#!/usr/bin/env parrot + +.sub 'main' :main + say "Hello!" +.end diff --git a/test/test_blob.rb b/test/test_blob.rb index 08d65be5..0e0b0112 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -82,6 +82,7 @@ class TestBlob < Test::Unit::TestCase assert blob("linguist.gem").binary? assert blob("octocat.ai").binary? assert blob("octocat.png").binary? + assert blob("hello.pbc").binary? assert !blob("README").binary? assert !blob("file.txt").binary? assert !blob("foo.rb").binary? @@ -317,6 +318,11 @@ class TestBlob < Test::Unit::TestCase # https://github.com/olabini/ioke assert_equal Language['Ioke'], blob("hello.ik").language + + # https://github.com/parrot/parrot + assert_equal Language['Parrot Internal Representation'], blob("hello.pir").language + assert_equal Language['Parrot Assembly'], blob("hello.pasm").language + assert_equal Language['Parrot Bytecode'], blob("hello.pbc").language end def test_lexer