diff options
| author | Joshua Peek <josh@joshpeek.com> | 2012-07-20 14:45:19 -0500 |
|---|---|---|
| committer | Joshua Peek <josh@joshpeek.com> | 2012-07-20 14:45:19 -0500 |
| commit | d063089430491fa6398ecebbe0ef7936634f34ea (patch) | |
| tree | 36ec6bfdeb29daa6e5688bf384990a7d932327bf | |
| parent | 0dcca7228d533f121cd354d5be77c05c4e4c968c (diff) | |
Add coq comments
| -rw-r--r-- | lib/linguist/tokenizer.rb | 6 | ||||
| -rw-r--r-- | test/test_tokenizer.rb | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/linguist/tokenizer.rb b/lib/linguist/tokenizer.rb index bf5fa38..a8afe67 100644 --- a/lib/linguist/tokenizer.rb +++ b/lib/linguist/tokenizer.rb @@ -72,6 +72,12 @@ module Linguist s.skip_until(/-->/) tokens << "-->" + # Coq multiline comments + elsif token = s.scan(/\(\*/) + tokens << "(*" + s.skip_until(/\*\)/) + tokens << "*)" + # Skip single or double quoted strings elsif s.scan(/"/) s.skip_until(/[^\\]"/) diff --git a/test/test_tokenizer.rb b/test/test_tokenizer.rb index 72693cf..e757c7d 100644 --- a/test/test_tokenizer.rb +++ b/test/test_tokenizer.rb @@ -36,6 +36,7 @@ class TestTokenizer < Test::Unit::TestCase 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(% %), tokenize("2 % 10\n% Comment") end |
