mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Add coq comments
This commit is contained in:
		| @@ -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(/[^\\]"/) | ||||||
|   | |||||||
| @@ -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 | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user