浏览代码

Small tweaks

Alex Dima 8 年之前
父节点
当前提交
da418eb8d9
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 0 4
      src/cpp.ts
  2. 2 0
      src/css.ts
  3. 4 2
      src/html.ts

+ 0 - 4
src/cpp.ts

@@ -282,16 +282,12 @@ export var language = <ILanguage> {
 
 		comment: [
 			[/[^\/*]+/, 'comment' ],
-			// [/\/\*/, 'comment', '@push' ],    // nested comment not allowed :-(
-			// [/\/\*/,    'comment.invalid' ],	// this breaks block comments in the shape of /* //*/
 			[/\*\//,    'comment', '@pop'  ],
 			[/[\/*]/,   'comment' ]
 		],
 		//Identical copy of comment above, except for the addition of .doc
 		doccomment: [
 			[/[^\/*]+/, 'comment.doc' ],
-			// [/\/\*/, 'comment.doc', '@push' ],    // nested comment not allowed :-(
-			[/\/\*/,    'comment.doc.invalid' ],
 			[/\*\//,    'comment.doc', '@pop'  ],
 			[/[\/*]/,   'comment.doc' ]
 		],

+ 2 - 0
src/css.ts

@@ -184,12 +184,14 @@ export var language = <IMonarchLanguage> {
 		stringenddoublequote: [
 			['\\\\.', 'string'],
 			['"', { token: 'string', next: '@pop' }],
+			[/[^\\"]+/, 'string'],
 			['.', 'string']
 		],
 
 		stringendquote: [
 			['\\\\.', 'string'],
 			['\'', { token: 'string', next: '@pop' }],
+			[/[^\\']+/, 'string'],
 			['.', 'string']
 		]
 	}

+ 4 - 2
src/html.ts

@@ -144,7 +144,8 @@ export var language = <ILanguage> {
 		],
 
 		scriptEmbedded: [
-			[/<\/script/, { token: '@rematch', next: '@pop', nextEmbedded: '@pop' }]
+			[/<\/script/, { token: '@rematch', next: '@pop', nextEmbedded: '@pop' }],
+			[/[^<]+/, '']
 		],
 
 		// -- END <script> tags handling
@@ -191,7 +192,8 @@ export var language = <ILanguage> {
 		],
 
 		styleEmbedded: [
-			[/<\/style/, { token: '@rematch', next: '@pop', nextEmbedded: '@pop' }]
+			[/<\/style/, { token: '@rematch', next: '@pop', nextEmbedded: '@pop' }],
+			[/[^<]+/, '']
 		],
 
 	// -- END <style> tags handling