docs(parser): docs

This commit is contained in:
Hoikan 2024-05-22 17:38:53 +08:00
parent 4a877cdc34
commit 00418eba82
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# OpenInula 2.0 Parser
This document describes the OpenInula 2.0 parser, which is used to parse the 2.0 API into a HIR (High-level Intermediate
Representation) that can be used by the OpenInula 2.0 compiler.
## Workflow
```mermaid
graph TD
A[OpenInula 2.0 Code] --> B[Visitor]
B --> C[VariableAnalyze]
B --> D[ViewAnalyze]
B --> E[fnMacroAnalyze]
B --> F[HookAnalyze-TODO]
C --> R[ReactivityParser]
D --> G[JSXParser]
G --> R
E --> R
F --> R
R --> |unused bit pruning|HIR
```
## Data Structure
see `types.ts` in `packages/transpiler/babel-inula-next-core/src/analyze/types.ts`
## TODO LIST
- [ ] for analyze the local variable, we need to consider the scope of the variable
- [ ] hook analyze