Skip to content

Commit b111d60

Browse files
Merge pull request #48 from augmentable-dev/add-elixir
add elixir single line comments
2 parents 3044bfb + 7832838 commit b111d60

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

pkg/comments/comments_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,17 @@ func TestJuliaFiles(t *testing.T) {
8989
t.Fail()
9090
}
9191
}
92+
93+
func TestElixirFiles(t *testing.T) {
94+
var comments Comments
95+
err := SearchDir("testdata/elixir", func(comment *Comment) {
96+
comments = append(comments, comment)
97+
})
98+
if err != nil {
99+
t.Fatal(err)
100+
}
101+
102+
if len(comments) != 2 {
103+
t.Fail()
104+
}
105+
}

pkg/comments/languages.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ var LanguageParseOptions map[Language]*lege.ParseOptions = map[Language]*lege.Pa
6767

6868
// TODO unfortunately, lege does't seem to handle the below boundaries very well, similar issue as to above I believe. Something with precendance?
6969
// Multi-line comments are not getting picked up...
70-
"Julia": {Boundaries: []lege.Boundary{{Start: "#=", End: "=#"}, {Start: "#", End: "\n"}}},
70+
"Julia": {Boundaries: []lege.Boundary{{Start: "#=", End: "=#"}, {Start: "#", End: "\n"}}},
71+
"Elixir": HashStyleCommentOptions,
7172
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# this is a comment
3+
# this is another
4+
IO.puts "Hello world from Elixir"

0 commit comments

Comments
 (0)