Created
October 10, 2008 21:29
-
-
Save ivey/16162 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; very basic cucumber mode for plain text stories | |
;;; send updates to [email protected] and maybe I'll | |
;;; release this on github | |
(defvar cucumber-mode-story-regexp | |
"^ *\\(Story:\\) *\\(.*\\)") | |
(defvar cucumber-mode-scenario-regexp | |
"^ *\\(Scenario:\\) *\\(.*\\)") | |
(defvar cucumber-mode-asiwantto-regexp | |
"^ *\\(As \\(an\\|a\\)\\|I want to\\|So that\\) *\\(.*\\)") | |
(defvar cucumber-mode-givenwhen-regexp | |
"^ *\\(Given\\|When\\|And\\|Then\\)") | |
(define-generic-mode cucumber-mode | |
() | |
() | |
`( | |
("\\(\\(.\\|[ | |
]\\)+\\)Story:" 1 'font-lock-comment-face) | |
(,cucumber-mode-story-regexp 1 'font-lock-keyword-face) | |
(,cucumber-mode-story-regexp 2 'font-lock-string-face) | |
(,cucumber-mode-scenario-regexp 1 'font-lock-keyword-face) | |
(,cucumber-mode-scenario-regexp 2 'font-lock-string-face) | |
(,cucumber-mode-asiwantto-regexp 1 'font-lock-keyword-face) | |
(,cucumber-mode-asiwantto-regexp 3 'font-lock-string-face) | |
(,cucumber-mode-givenwhen-regexp 1 'font-lock-function-name-face) | |
) | |
'(".feature\\'") | |
nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment