Strip tex and matlab leading inline comments

This commit is contained in:
Joshua Peek
2012-06-21 10:38:28 -05:00
parent 4b9b8a5058
commit 497da86262
3 changed files with 135 additions and 203 deletions

View File

@@ -49,6 +49,11 @@ module Linguist
tokens << "//"
s.skip_until(/\n|\Z/)
# Leading Tex or Matlab comments
elsif token = s.scan(/\n%/)
tokens << "%"
s.skip_until(/\n|\Z/)
# C multiline comments
elsif token = s.scan(/\/\*/)
tokens << "/*"
@@ -89,7 +94,7 @@ module Linguist
tokens << token
# Common operators
elsif token = s.scan(/<<?|\+|\-|\*|\/|&&?|\|\|?/)
elsif token = s.scan(/<<?|\+|\-|\*|\/|%|&&?|\|\|?/)
tokens << token
else