{"id":15665979,"url":"https://github.com/luozijun/es","last_synced_at":"2025-10-29T00:50:55.334Z","repository":{"id":48314309,"uuid":"140124007","full_name":"LuoZijun/es","owner":"LuoZijun","description":"  A ECMAScript Parser and Interpreter written in Rust","archived":false,"fork":false,"pushed_at":"2021-08-02T05:26:04.000Z","size":4978,"stargazers_count":11,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T14:04:59.785Z","etag":null,"topics":["ast","compiler","ecmascript","es","es2018","interpreter","lexer","parser"],"latest_commit_sha":null,"homepage":"https://luozijun.github.io/es/ecmascript/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LuoZijun.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-07T23:38:03.000Z","updated_at":"2024-08-07T11:24:37.000Z","dependencies_parsed_at":"2022-08-24T04:22:05.119Z","dependency_job_id":null,"html_url":"https://github.com/LuoZijun/es","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuoZijun%2Fes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuoZijun%2Fes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuoZijun%2Fes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuoZijun%2Fes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuoZijun","download_url":"https://codeload.github.com/LuoZijun/es/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252892503,"owners_count":21820648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast","compiler","ecmascript","es","es2018","interpreter","lexer","parser"],"created_at":"2024-10-03T13:58:39.972Z","updated_at":"2025-10-29T00:50:50.303Z","avatar_url":"https://github.com/LuoZijun.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"ECMAScript\n==================================\n\n.. contents::\n\n\nWork in progress (WIP).\n\n\n项目状态\n----------\n\n*   ✅ 词法分析器 (Lexer)\n*   🦋 语法分析器 (Parser)\n*   🔜 编译器 (Compiler)\n*   🔜 解释器 (Interpreter)\n\n**Lexer**:\n\n*JSX*:\n\n*   ❌ JSXText\n\n**Parser**:\n\n*   ✅ EmptyStatement\n*   ✅ DebuggerStatement\n*   ❌ Expression\n\n    *   ✅ Identifier\n    *   ✅ LiteralNull\n    *   ✅ LiteralBoolean\n    *   ✅ LiteralString\n    *   ✅ LiteralNumeric\n    *   ✅ LiteralRegularExpression\n    *   ✅ LiteralTemplateExpression\n    *   ❌ LiteralArray\n    *   ❌ LiteralObject\n    *   ✅ ThisExpression\n    *   ✅ MemberExpression ( include `SuperMemberExpression` )\n    *   ✅ NewTargetExpression\n    *   ✅ NewExpression\n    *   ✅ PrefixExpression\n    *   ✅ InfixExpression\n    *   ✅ PostfixExpression\n    *   ✅ AssignmentExpression\n    *   ✅ ConditionalExpression\n    *   ✅ YieldExpression\n    *   ✅ CallExpression ( include `SuperCallExpression` )\n    *   ✅ TaggedTemplate\n    *   ✅ SpreadExpression\n    *   ✅ CommaExpression\n    *   ✅ ParenthesizedExpression ( Grouping )\n    *   ❌ ObjectBindingPattern ( Destructuring )\n    *   ❌ ArrayBindingPattern ( Destructuring )\n    *   ✅ ClassExpression\n    *   ✅ FunctionExpression\n    *   ✅ GeneratorExpression\n    *   ✅ AsyncFunctionExpression\n    *   ✅ AsyncGeneratorExpression\n    *   ✅ ArrowFunctionExpression\n    *   ✅ AsyncArrowFunctionExpression\n\n*   ❌ VariableStatement\n*   ✅ BlockStatement\n*   ❌ IfStatement\n*   ❌ DoWhileStatement\n*   ❌ WhileStatement\n*   ❌ ForStatement\n*   ❌ ForInStatement\n*   ❌ ForOfStatement\n*   ❌ ForAwaitOfStatement\n*   ❌ ContinueStatement\n*   ❌ BreakStatement\n*   ❌ ReturnStatement\n*   ❌ WithStatement\n*   ❌ SwitchStatement\n*   ❌ LabelledStatement\n*   ❌ ThrowStatement\n*   ❌ TryStatement\n*   ✅ FunctionDeclaration\n*   ✅ ClassDeclaration\n\n*JSX*:\n\n*   ❌ JSXFragment\n*   ❌ JSXElement ( JSXSelfClosingElement, JSXNormalElement, )\n\n*Scripts and Modules*:\n\n*   ❌ ImportDeclaration\n*   ❌ ExportDeclaration\n\n\n原则\n----------\n\n1. 完全尊重 ECMAScript 语言规范，规范之外的内容均不会考虑(JSX 将是唯一的一个例外)。\n2. 语法分析器和解释器只支持严格模式，这意味着一些在非严格模式下的语法都将会直接抛出错误。\n3. 分号自动补全问题，这个还没有定，个人倾向于必须写。\n\n\n愿景\n----------\n\n1. 语法分析器完整支持 ECMAScript 已发布语法规范(Release)，处于提议阶段的语法特性或其它组织定义的语法都不会考虑（JSX例外）。\n2. 编译器支持编译为 字节码(ByteCode) 和 低版本的源代码(ES2011 - ES2018)。\n3. 实现一个简单的解释器。\n\n\n友好的错误提示\n---------------\n\n.. code::\n\n    ~/P/es\u003e cargo run --example esc -- \u003c in.js\n\n    SyntaxError: Unexpected Character `/`\n     --\u003e src/main.js:1:1\n      |\n    1 | #/usr/bin/env python3\n      |  ^\n\n\n用例\n---------\n\n这是设想当中的使用方法，目前处于不可用状态。\n\n\n.. code:: bash\n    \n    esc src/main.js\n    esc src/index.html\n    esc --to es2011 src/main.js\n    esc --to es2011 --bundle src/main.js\n    \n    esi src/main.js\n\n\nFAQ\n--------\n\n会考虑支持 ECMAScript 语言的一些超集或子集(如: TypeScript/Flow)吗？\n\n    除了 `JSX` 其它的都不会考虑。\n\n会考虑实现目前尚处于提议阶段的语法特性和内建API设计吗？\n\n    不会，如果最终这些提议能够顺利进入发布阶段，那个时候肯定会去实现改提议的特性。\n\n一些在现有生态代码里面非常常见的写法（如 Babel 支持它），但它不是 ECMAScript 规范的一部分，这样的语法特性会考虑兼容吗？\n\n    不会。\n\n\nLicense\n---------\n\nMIT license (LICENSE or http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluozijun%2Fes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluozijun%2Fes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluozijun%2Fes/lists"}