Commit 52020a00dd42660f935721910dbab9b081a5d39a

Andre Wiggins 2016-12-05T07:17:38

Update typescript keywords (#1064) * Update TypeScript keyword list * Add comment with URL to TS spec

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/components/prism-typescript.js b/components/prism-typescript.js
index dde12ce..2b4e46d 100755
--- a/components/prism-typescript.js
+++ b/components/prism-typescript.js
@@ -1,5 +1,6 @@
 Prism.languages.typescript = Prism.languages.extend('javascript', {
-	'keyword': /\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield|module|declare|constructor|string|Function|any|number|boolean|Array|enum)\b/
+	// From JavaScript Prism keyword list and TypeScript language spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#221-reserved-words
+	'keyword': /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield|false|true|module|declare|constructor|string|Function|any|number|boolean|Array|enum|symbol|namespace|abstract|require|type)\b/
 });
 
 Prism.languages.ts = Prism.languages.typescript;
\ No newline at end of file