Переглянути джерело

Fixes microsoft/monaco-editor#557: VB can have mult-line strings

Alexandru Dima 5 роки тому
батько
коміт
4e2ba08fc6
2 змінених файлів з 19 додано та 2 видалено
  1. 19 1
      src/vb/vb.test.ts
  2. 0 1
      src/vb/vb.ts

+ 19 - 1
src/vb/vb.test.ts

@@ -434,5 +434,23 @@ testTokenization('vb', [
 			{ startIndex: 13, type: '' },
 			{ startIndex: 14, type: 'keyword.tag-for.vb' }
 		]
-	}]
+	}],
+
+	[{
+		line: 'Dim x = "hello',
+		tokens: [
+			{ startIndex: 0, type: 'keyword.dim.vb' },
+			{ startIndex: 3, type: '' },
+			{ startIndex: 4, type: 'identifier.vb' },
+			{ startIndex: 5, type: '' },
+			{ startIndex: 6, type: 'delimiter.vb' },
+			{ startIndex: 7, type: '' },
+			{ startIndex: 8, type: 'string.vb' }
+		]
+	}, {
+		line: 'world"',
+		tokens: [
+			{ startIndex: 0, type: 'string.vb' },
+		]
+	}],
 ]);

+ 0 - 1
src/vb/vb.ts

@@ -169,7 +169,6 @@ export const language = <ILanguage>{
 			[/@symbols/, 'delimiter'],
 
 			// strings
-			[/"([^"\\]|\\.)*$/, 'string.invalid'],  // non-teminated string
 			[/"/, 'string', '@string'],
 
 		],