mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Detect Parrot assembly and bytecode individually, and add some tests
This commit is contained in:
@@ -643,16 +643,30 @@ PHP:
|
|||||||
- .phpt
|
- .phpt
|
||||||
|
|
||||||
Parrot Internal Representation:
|
Parrot Internal Representation:
|
||||||
|
type: programming
|
||||||
lexer: Text only
|
lexer: Text only
|
||||||
search_term: pir
|
search_term: pir
|
||||||
aliases:
|
aliases:
|
||||||
- pir
|
- pir
|
||||||
primary_extension: .pir
|
primary_extension: .pir
|
||||||
extensions:
|
extensions:
|
||||||
- .pasm
|
|
||||||
- .pbc
|
|
||||||
- .pir
|
- .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:
|
Perl:
|
||||||
type: programming
|
type: programming
|
||||||
overrides:
|
overrides:
|
||||||
|
|||||||
5
test/fixtures/hello.pasm
vendored
Normal file
5
test/fixtures/hello.pasm
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env parrot
|
||||||
|
|
||||||
|
.pcc_sub :main main:
|
||||||
|
say "Hello!"
|
||||||
|
end
|
||||||
BIN
test/fixtures/hello.pbc
vendored
Normal file
BIN
test/fixtures/hello.pbc
vendored
Normal file
Binary file not shown.
5
test/fixtures/hello.pir
vendored
Normal file
5
test/fixtures/hello.pir
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env parrot
|
||||||
|
|
||||||
|
.sub 'main' :main
|
||||||
|
say "Hello!"
|
||||||
|
.end
|
||||||
@@ -82,6 +82,7 @@ class TestBlob < Test::Unit::TestCase
|
|||||||
assert blob("linguist.gem").binary?
|
assert blob("linguist.gem").binary?
|
||||||
assert blob("octocat.ai").binary?
|
assert blob("octocat.ai").binary?
|
||||||
assert blob("octocat.png").binary?
|
assert blob("octocat.png").binary?
|
||||||
|
assert blob("hello.pbc").binary?
|
||||||
assert !blob("README").binary?
|
assert !blob("README").binary?
|
||||||
assert !blob("file.txt").binary?
|
assert !blob("file.txt").binary?
|
||||||
assert !blob("foo.rb").binary?
|
assert !blob("foo.rb").binary?
|
||||||
@@ -317,6 +318,11 @@ class TestBlob < Test::Unit::TestCase
|
|||||||
|
|
||||||
# https://github.com/olabini/ioke
|
# https://github.com/olabini/ioke
|
||||||
assert_equal Language['Ioke'], blob("hello.ik").language
|
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
|
end
|
||||||
|
|
||||||
def test_lexer
|
def test_lexer
|
||||||
|
|||||||
Reference in New Issue
Block a user