Add coq comments

This commit is contained in:
Joshua Peek
2012-07-20 14:45:19 -05:00
parent 0dcca7228d
commit d063089430
2 changed files with 7 additions and 0 deletions

View File

@@ -72,6 +72,12 @@ module Linguist
s.skip_until(/-->/) s.skip_until(/-->/)
tokens << "-->" tokens << "-->"
# Coq multiline comments
elsif token = s.scan(/\(\*/)
tokens << "(*"
s.skip_until(/\*\)/)
tokens << "*)"
# Skip single or double quoted strings # Skip single or double quoted strings
elsif s.scan(/"/) elsif s.scan(/"/)
s.skip_until(/[^\\]"/) s.skip_until(/[^\\]"/)

View File

@@ -36,6 +36,7 @@ class TestTokenizer < Test::Unit::TestCase
assert_equal %w(foo /* */), tokenize("foo /* \nComment\n */") assert_equal %w(foo /* */), tokenize("foo /* \nComment\n */")
assert_equal %w(foo <!-- -->), tokenize("foo <!-- Comment -->") assert_equal %w(foo <!-- -->), tokenize("foo <!-- Comment -->")
assert_equal %w(foo {- -}), tokenize("foo {- Comment -}") assert_equal %w(foo {- -}), tokenize("foo {- Comment -}")
assert_equal %w(foo \(* *\)), tokenize("foo (* Comment *)")
assert_equal %w(% %), tokenize("2 % 10\n% Comment") assert_equal %w(% %), tokenize("2 % 10\n% Comment")
end end