diff options
author | teeler <teeler@gmail.com> | 2020-01-08 15:10:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-08 15:10:22 -0800 |
commit | 9dfa8d8474eb60a626d9f8439362e49b1c3dca54 (patch) | |
tree | 558e6ca1a10a6edcd06499a043bff4340fcbcf26 /commentparser | |
parent | fabe6f05e8b43909344a7803028613498307749d (diff) | |
download | licenseclassifier-9dfa8d8474eb60a626d9f8439362e49b1c3dca54.tar.gz |
Merge with downstream (#16)
Diffstat (limited to 'commentparser')
-rw-r--r-- | commentparser/comment_parser.go | 11 | ||||
-rw-r--r-- | commentparser/language/language.go | 4 |
2 files changed, 5 insertions, 10 deletions
diff --git a/commentparser/comment_parser.go b/commentparser/comment_parser.go index 1f4bc8f..b6028b3 100644 --- a/commentparser/comment_parser.go +++ b/commentparser/comment_parser.go @@ -20,7 +20,6 @@ package commentparser import ( "bytes" - "log" "strings" "unicode/utf8" @@ -28,9 +27,9 @@ import ( ) const ( - eofInString = "commentparser: Line %d > EOF in string" - eofInSingleLineComment = "commentparser: Line %d > EOF in single line comment" - eofInMultilineComment = "commentparser: Line %d > EOF in multiline comment" + eofInString = "%d:EOF in string" + eofInSingleLineComment = "%d:EOF in single line comment" + eofInMultilineComment = "%d:EOF in multiline comment" ) // Parse parses the input data and returns the comments. @@ -192,7 +191,6 @@ func (i *input) lex() { for { c, ok = i.peekRune() if !ok { - log.Printf(eofInString, startLine) return } if hasEscape && c == '\\' { @@ -211,7 +209,6 @@ func (i *input) lex() { content.WriteRune(c) } if i.eof() { - log.Printf(eofInString, startLine) return } } @@ -230,7 +227,6 @@ func (i *input) lex() { startLine := i.pos.line for { if i.eof() { - log.Printf(eofInMultilineComment, startLine) return } c := i.readRune() @@ -257,7 +253,6 @@ func (i *input) lex() { } else if i.singleLineComment() { // Single line comment for { if i.eof() { - log.Printf(eofInSingleLineComment, i.pos.line) return } c = i.readRune() diff --git a/commentparser/language/language.go b/commentparser/language/language.go index 78ee4e0..457e936 100644 --- a/commentparser/language/language.go +++ b/commentparser/language/language.go @@ -32,10 +32,10 @@ const ( BLIF // Berkley Logic Interface Format Batch C - CMake - CSharp Clif Clojure + CMake + CSharp Dart EDIF // Electronic Design Interchange Format Elixir |