|
| 1 | +# Pine Script Compiler (v4/v5/v6) |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + <img src="assets/logo.svg" alt="Pine Script Compiler logo" width="160"/> |
| 5 | +</p> |
| 6 | + |
| 7 | +     |
| 8 | + |
| 9 | +English | [中文](#中文说明) |
| 10 | + |
| 11 | +A local, incremental Pine Script compiler providing syntax and semantic analysis, aiming to power high-quality tooling and CI for TradingView Pine Script (v4/v5/v6). |
| 12 | + |
| 13 | +**Features** |
| 14 | +- Syntax parsing and AST scaffolding |
| 15 | +- Early-stage semantic analyzer |
| 16 | +- CLI entry with scripts: `dev`, `build`, `type-check`, `test`, `start` |
| 17 | +- CI with Node 18.x/20.x, ESLint annotations, TypeScript check and build |
| 18 | + |
| 19 | +**Quick Start** |
| 20 | +- `git clone https://github.com/CHANGGELY/pine-script-compiler.git` |
| 21 | +- `cd pine-script-compiler` |
| 22 | +- `npm install` |
| 23 | +- Develop: `npm run dev` (runs `src/cli.ts` with `tsx`) |
| 24 | +- Type-check & test: `npm run type-check` and `npm test -- --coverage` |
| 25 | +- Build and run CLI: `npm run build` and `npm run start -- --help` |
| 26 | + |
| 27 | +**Roadmap** |
| 28 | +- Robust lexer and parser |
| 29 | +- Type system and inference |
| 30 | +- Full semantic rules and diagnostics |
| 31 | +- Cross-version support (v4/v5/v6 specifics) |
| 32 | +- Release binaries and docs |
| 33 | + |
| 34 | +**Contributing** |
| 35 | +- PRs welcome. Follow ESLint/Prettier rules; CI annotates issues as warnings. |
| 36 | +- Use clear commit messages (English or Chinese). For large changes, include a short design note in PR description. |
| 37 | + |
| 38 | +**License** |
| 39 | +- MIT |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## 中文说明 |
| 44 | + |
| 45 | +一个本地增量式的 Pine Script 编译器,提供语法解析与语义分析,目标是为 Pine Script(v4/v5/v6)打造高质量的开发工具链与 CI 能力。 |
| 46 | + |
| 47 | +**特性** |
| 48 | +- 语法解析与 AST 框架 |
| 49 | +- 语义分析雏形 |
| 50 | +- CLI 入口与脚本:`dev`、`build`、`type-check`、`test`、`start` |
| 51 | +- CI:Node 18.x/20.x,ESLint 注解、TypeScript 检查与构建 |
| 52 | + |
| 53 | +**快速开始** |
| 54 | +- `git clone https://github.com/CHANGGELY/pine-script-compiler.git` |
| 55 | +- `cd pine-script-compiler` |
| 56 | +- `npm install` |
| 57 | +- 开发调试:`npm run dev`(使用 `tsx` 运行 `src/cli.ts`) |
| 58 | +- 类型检查与测试:`npm run type-check` 与 `npm test -- --coverage` |
| 59 | +- 构建与运行 CLI:`npm run build` 与 `npm run start -- --help` |
| 60 | + |
| 61 | +**规划路线** |
| 62 | +- 强健的词法/语法分析器 |
| 63 | +- 类型系统与推断 |
| 64 | +- 完整的语义规则与诊断 |
| 65 | +- 多版本差异支持(v4/v5/v6) |
| 66 | +- 发布二进制与文档 |
| 67 | + |
| 68 | +**参与贡献** |
| 69 | +- 欢迎 PR。请遵循 ESLint/Prettier 规则;CI 会以注解形式提示问题。 |
| 70 | +- 提交信息中英文皆可;重大变更请在 PR 描述附简要设计说明。 |
| 71 | + |
| 72 | +**许可证** |
| 73 | +- MIT |
0 commit comments