mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge pull request #1723 from techhat/pythonmultiline
Python also supports triple single-quotes for comments
This commit is contained in:
@@ -33,7 +33,8 @@ module Linguist
|
|||||||
['<!--', '-->'], # XML
|
['<!--', '-->'], # XML
|
||||||
['{-', '-}'], # Haskell
|
['{-', '-}'], # Haskell
|
||||||
['(*', '*)'], # Coq
|
['(*', '*)'], # Coq
|
||||||
['"""', '"""'] # Python
|
['"""', '"""'], # Python
|
||||||
|
["'''", "'''"] # Python
|
||||||
]
|
]
|
||||||
|
|
||||||
START_SINGLE_LINE_COMMENT = Regexp.compile(SINGLE_LINE_COMMENTS.map { |c|
|
START_SINGLE_LINE_COMMENT = Regexp.compile(SINGLE_LINE_COMMENTS.map { |c|
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ class TestTokenizer < Minitest::Test
|
|||||||
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")
|
||||||
|
assert_equal %w(foo bar), tokenize("foo\n\"\"\"\nComment\n\"\"\"\nbar")
|
||||||
|
assert_equal %w(foo bar), tokenize("foo\n'''\nComment\n'''\nbar")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_sgml_tags
|
def test_sgml_tags
|
||||||
|
|||||||
Reference in New Issue
Block a user