Browse Source

Add definition for identifier.quote (to match dax syntax)

Matt Masson 7 years ago
parent
commit
985b1bdc11
2 changed files with 6 additions and 6 deletions
  1. 4 4
      src/powerquery/powerquery.test.ts
  2. 2 2
      src/powerquery/powerquery.ts

+ 4 - 4
src/powerquery/powerquery.test.ts

@@ -79,18 +79,18 @@ testTokenization('powerquery', [
 		]
 	}],
 
-	// Escaped Identifiers
+	// Quoted Identifiers
 	[{
 		line: '#"Change Types"',
 		tokens: [
-			{ startIndex: 0, type: 'identifier.pq' }
+			{ startIndex: 0, type: 'identifier.quote.pq' }
 		]
 	}],
 
 	[{
 		line: '#"A  B" = 1+2,',
 		tokens: [
-			{ startIndex: 0, type: 'identifier.pq' },
+			{ startIndex: 0, type: 'identifier.quote.pq' },
 			{ startIndex: 7, type: 'white.pq' },
 			{ startIndex: 8, type: 'operator.pq' },
 			{ startIndex: 9, type: 'white.pq' },
@@ -108,7 +108,7 @@ testTokenization('powerquery', [
 			{ startIndex: 1, type: 'white.pq' },
 			{ startIndex: 2, type: 'operator.pq' },
 			{ startIndex: 3, type: 'white.pq' },
-			{ startIndex: 4, type: 'identifier.pq' },
+			{ startIndex: 4, type: 'identifier.quote.pq' },
 			{ startIndex: 15, type: 'operator.pq' },
 			{ startIndex: 16, type: 'white.pq' },
 			{ startIndex: 17, type: 'number.pq' }

+ 2 - 2
src/powerquery/powerquery.ts

@@ -69,8 +69,8 @@ export const language = <ILanguage>{
 
 	tokenizer: {
 		root: [
-			// escaped identifier
-			[/#"[\w \.]+"/, "identifier"],
+			// quoted identifier
+			[/#"[\w \.]+"/, "identifier.quote"],
 
 			// numbers
 			[/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],