From 00418eba82bb0b26bba556966a6261b041a1fcf3 Mon Sep 17 00:00:00 2001 From: Hoikan <30694822+HoikanChan@users.noreply.github.com> Date: Wed, 22 May 2024 17:38:53 +0800 Subject: [PATCH] docs(parser): docs --- docs/inula-next/OpenInula 2.0 Parser.md | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/inula-next/OpenInula 2.0 Parser.md diff --git a/docs/inula-next/OpenInula 2.0 Parser.md b/docs/inula-next/OpenInula 2.0 Parser.md new file mode 100644 index 00000000..566138da --- /dev/null +++ b/docs/inula-next/OpenInula 2.0 Parser.md @@ -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