Closed
Description
current patch use XXX == 'keyword' || XXX == 'trans_keyword'
inline to support different languages
could be replaced by a set of isKeyword[Keyword] function and wrap the matching detail inside of the function
ex, instead of XXX == 'Symbol' || XXX == '中文'
replace to isKeyword(XXX)
and define function
function isKeywordSymbol(value) {
return value == 'Symbol' || value == '中文'
}
The change could be proposed to TypeScript for maintainability.
By replacing the isKeyword[Keyword] functions, LingaScript could even support parse multi-native-language keywords in the same compiler