Skip to content

Commit d3c78f6

Browse files
Add MIPS support (#82)
1 parent 6213279 commit d3c78f6

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

lib/languages/mips.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!e
2+
#\p

test/languages/mips_test.rb

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require "test_helper"
2+
3+
module SnippetExtractor
4+
module Languages
5+
class MipsTest < Minitest::Test
6+
def test_full_example
7+
code = <<~CODE
8+
# General comment
9+
#
10+
# $a0 - input
11+
12+
.globl binary_convert
13+
14+
binary_convert:
15+
li $v0, 0 # line comment
16+
17+
# Another line comment
18+
end:
19+
jr $ra
20+
21+
CODE
22+
23+
expected = <<~CODE
24+
.globl binary_convert
25+
26+
binary_convert:
27+
li $v0, 0
28+
29+
end:
30+
jr $ra
31+
32+
CODE
33+
34+
assert_equal expected, ExtractSnippet.(code, :nim)
35+
end
36+
end
37+
end
38+
end

0 commit comments

Comments
 (0)