大文字対応
This commit is contained in:
		
							parent
							
								
									3742f4fe52
								
							
						
					
					
						commit
						4330d41f5d
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		|  | @ -25,7 +25,7 @@ function escape(text) { | ||||||
| 
 | 
 | ||||||
| // 文字数が多い順にソートします
 | // 文字数が多い順にソートします
 | ||||||
| // そうしないと、「function」という文字列が与えられたときに「func」が先にマッチしてしまう可能性があるためです
 | // そうしないと、「function」という文字列が与えられたときに「func」が先にマッチしてしまう可能性があるためです
 | ||||||
| const keywords = [ | const _keywords = [ | ||||||
| 	'true', | 	'true', | ||||||
| 	'false', | 	'false', | ||||||
| 	'null', | 	'null', | ||||||
|  | @ -94,7 +94,12 @@ const keywords = [ | ||||||
| 	'extends', | 	'extends', | ||||||
| 	'implements', | 	'implements', | ||||||
| 	'constructor' | 	'constructor' | ||||||
| ].sort((a, b) => b.length - a.length); | ]; | ||||||
|  | 
 | ||||||
|  | const keywords = _keywords | ||||||
|  | 	.concat(_keywords.map(k => k[0].toUpperCase() + k.substr(1))) | ||||||
|  | 	.concat(_keywords.map(k => k.toUpperCase())) | ||||||
|  | 	.sort((a, b) => b.length - a.length); | ||||||
| 
 | 
 | ||||||
| const symbols = [ | const symbols = [ | ||||||
| 	'=', | 	'=', | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue