Bläddra i källkod

Changed to use linecomment for continuation comments

nreed 4 år sedan
förälder
incheckning
4dbc07d557
1 ändrade filer med 8 tillägg och 2 borttagningar
  1. 8 2
      src/cpp/cpp.ts

+ 8 - 2
src/cpp/cpp.ts

@@ -347,16 +347,22 @@ export const language = <languages.IMonarchLanguage>{
 			[/[ \t\r\n]+/, ''],
 			[/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'],
 			[/\/\*/, 'comment', '@comment'],
-			[/\/\/.*\\$/, 'comment', '@comment'],
+			[/\/\/.*\\$/, 'comment', '@linecomment'],
 			[/\/\/.*$/, 'comment']
 		],
 
 		comment: [
-			[/.*[^\\]$/, 'comment', '@pop'],
 			[/[^\/*]+/, 'comment'],
 			[/\*\//, 'comment', '@pop'],
 			[/[\/*]/, 'comment']
 		],
+		
+		//For use with continuous line comments
+		linecomment: [
+			[/.*[^\\]$/, 'comment', '@pop'],
+			[/[^]+/, 'comment']
+		],
+		
 		//Identical copy of comment above, except for the addition of .doc
 		doccomment: [
 			[/[^\/*]+/, 'comment.doc'],