summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorGaurav Jain <gaurav@gauravjain.org>2014-04-27 11:35:02 -0400
committerGaurav Jain <gaurav@gauravjain.org>2014-04-27 11:35:02 -0400
commit603816096833d0f930210517876a72f4af6b4cfd (patch)
tree689b8fea1dc47545979bfc45411f74e88e1a5d01 /pygments
parent0c7f160e848d472bbe8f0e277b4f11dece859cc0 (diff)
downloadpygments-603816096833d0f930210517876a72f4af6b4cfd.tar.gz
Gherkin: Comments should only be matched on distinct lines
According to https://github.com/cucumber/cucumber/wiki/Gherkin, cooments are complete lines that can appear anywhere in the file and have leading whitespace. Added valid example file which was validated with 'cucumber -r -d tests/examplefiles/example.feature'
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/other.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py
index 47a4b865..acec8bb1 100644
--- a/pygments/lexers/other.py
+++ b/pygments/lexers/other.py
@@ -1866,7 +1866,7 @@ class GherkinLexer(RegexLexer):
tokens = {
'comments': [
- (r'#.*$', Comment),
+ (r'^\s*#.*$', Comment),
],
'feature_elements' : [
(step_keywords, Keyword, "step_content_stack"),
@@ -1895,6 +1895,7 @@ class GherkinLexer(RegexLexer):
],
'narrative': [
include('scenario_sections_on_stack'),
+ include('comments'),
(r"(\s|.)", Name.Function),
],
'table_vars': [