Skip to content

Latest commit

 

History

History
68 lines (56 loc) · 1.21 KB

README.md

File metadata and controls

68 lines (56 loc) · 1.21 KB

Description

simple babel。旨在深入理解babel的词法分析,替换等核心功能。

目前支持支持语法解析,语法转换以及代码生成

语法解析

Statement

  • VariableDeclaration
  • ClassDeclaration
  • FunctionDeclaration
  • ExpressionStatement
  • BlockStatement
  • LabeledStatement
  • SwitchStatement
  • BreakStatement
  • ContinueStatement
  • EmptyStatement
  • ThrowStatement
  • ReturnStatement
  • IfStatement
  • ForStatement
  • ForInStatement
  • WhileStatement
  • DoWhileStatement
  • TryStatement
  • DebuggerStatement

Expression

  • thisExpression
  • SequenceExpression
  • AssignmentExpression
  • UpdateExpression
  • UnaryExpression
  • MemberExpression
  • LogicalExpression
  • BinaryExpression
  • CallExpression
  • FunctionExpression
  • VariableDeclarator
  • ObjectExpression
  • ArrayExpression
  • ConditionalExpression
  • NewExpression
  • ArrowFunctionExpression
  • Property
  • Literal
  • Identifier
  • AssignmentPattern

语法转换以及代码生成

  • arrowFunctionExpression
  • block-bind

How to test

npm install
npm run test