8000 wrap keyword matching code to functions · Issue #18 · gasolin/lingascript · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
wrap keyword matching code to functions #18
Closed
@gasolin

Description

@gasolin

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0