Permalink
Browse files

Correct definition for nested D comments

  • Loading branch information...
1 parent 1d79d51 commit 3ef21d11a4102d4b27ea8b99d4c46cf9b8dfdcf5 @isagalaev committed Apr 9, 2012
Showing with 4 additions and 39 deletions.
  1. +4 −39 src/languages/d.js
View
@@ -267,48 +267,13 @@ hljs.LANGUAGES.d = function() {
*
* @type {Object}
*/
- var D_NESTING_COMMENT_L1_MODE = { // what follows is an ugly way of supporting nesting comments
+ var D_NESTING_COMMENT_MODE = {
className: 'comment',
begin: '\\/\\+',
+ contains: ['self'],
end: '\\+\\/',
relevance: 10
- }, D_NESTING_COMMENT_L2_MODE = {
- className: 'comment',
- begin: '\\/\\+',
- contains: [D_NESTING_COMMENT_L1_MODE],
- end: '\\+\\/',
- relevance: 10
- }, D_NESTING_COMMENT_L3_MODE = {
- className: 'comment',
- begin: '\\/\\+',
- contains: [D_NESTING_COMMENT_L2_MODE],
- end: '\\+\\/',
- relevance: 10
- }, D_NESTING_COMMENT_L4_MODE = {
- className: 'comment',
- begin: '\\/\\+',
- contains: [D_NESTING_COMMENT_L3_MODE],
- end: '\\+\\/',
- relevance: 10
- }, D_NESTING_COMMENT_L5_MODE = {
- className: 'comment',
- begin: '\\/\\+',
- contains: [D_NESTING_COMMENT_L4_MODE],
- end: '\\+\\/',
- relevance: 10
- }, D_NESTING_COMMENT_L6_MODE = {
- className: 'comment',
- begin: '\\/\\+',
- contains: [D_NESTING_COMMENT_L5_MODE],
- end: '\\+\\/',
- relevance: 10
- }, D_NESTING_COMMENT_MODE = {
- className: 'comment',
- begin: '\\/\\+',
- contains: [D_NESTING_COMMENT_L6_MODE],
- end: '\\+\\/',
- relevance: 10
- };
+ }
return {
defaultMode: {
@@ -332,4 +297,4 @@ hljs.LANGUAGES.d = function() {
]
}
};
-}();
+}();

0 comments on commit 3ef21d1

Please sign in to comment.