Skip to content

简易版babel工程实现,旨在深入了解词法分析以及其语法转换

Notifications You must be signed in to change notification settings

itshizhan/simple-babel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

简易版babel工程实现,旨在深入了解词法分析以及其语法转换

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%