Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrap keyword matching code to functions #18

Closed
gasolin opened this issue Feb 14, 2019 · 1 comment
Closed

wrap keyword matching code to functions #18

gasolin opened this issue Feb 14, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@gasolin
Copy link
Owner

gasolin commented Feb 14, 2019

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

@gasolin gasolin added enhancement New feature or request help wanted Extra attention is needed labels Feb 14, 2019
@gasolin gasolin self-assigned this Feb 15, 2019
@gasolin
Copy link
Owner Author

gasolin commented Feb 19, 2019

first attempt at 3b007cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant