- Vitest 1.6 + v8 coverage reporting, baseline ≥88% statements
- GitHub Actions CI: lint + test matrix (Node 18/20/22 × Ubuntu/Windows) + build + compat summary
- 14 Vietnamese keyword aliases:
biến,nhường,đây,rỗng,tĩnh,công khai,riêng tư,bảo vệ,lấy,gán,vô cực,của,lặp,là kiểu CONTRIBUTING.mdvới template thêm parser node + Unicode boundary rulesscripts/compat-summary.mjs— dashboard đọccompatibility.md+coverage-summary.jsondocs/compatibility.md+docs/roadmap.md
- Arrow function (single param, paren, multi, empty; expr + block body)
- Default parameters (
AssignmentPattern) - Rest parameters (
RestElement) + validation vị trí - Spread (
...) trong array / object / call - Destructuring object: shorthand, rename, default, rest, nested
- Destructuring array: hole, default, rest, nested, mixed
- Template literal interpolation
${...}với nested braces for...of/for...in/for await ... of- Object shorthand
{a}+ computed key{[k]: v}
- Private field
#x(ClassPrivateProperty) - Getter/setter trong class + object literal (
lấy/gán) - Yield expression +
yield*(tiếng Việt:nhường) - Optional chaining edge cases:
?.prop,?.[k], chained - Compound assignment đầy đủ (16 operators):
+=,-=,*=,/=,%=,**=,&=,|=,^=,<<=,>>=,>>>=,||=,&&=,??= - Numeric literals nâng cao: hex
0x, octal0o, binary0b, BigInt123n, separator1_000 - Regex literal
/x/givới context-aware tokenization - String escape sequences:
\n,\t,\x41,\u{1F600}, v.v. - Labeled break/continue + fix bug
ContinueStatementăn nhầmBREAKkeyword - Ternary
c ? a : b(ConditionalExpression) NewExpressionvới args +SpreadElementTaggedTemplateExpressionSuperExpression(call + member)InfinityIdentifier- Dynamic import
sử dụng("path") - Optional catch binding
bắt lỗi {} - Access modifiers trong class (
công khai/riêng tư/bảo vệ) - Static method/property with
tĩnhkeyword - Generator method
*foo() - Method detection trong class body (transition ClassProperty → ClassMethod khi thấy
()
- Identifier mangling mới:
xin chào→xin_chào(Unicode trực tiếp, thay vì codepoint_xin_ch224o)
VietScriptErrorclass vớifile:line:col+ snippet + caret + hintParser.filenamesupport
@vietscript/clipackage với commands:run,build,watch,check- Source maps qua
@babel/generator - Node ESM loader:
node --import '@vietscript/cli/register' file.vjs - Bun plugin:
@vietscript/cli/bun-plugin - Binary:
vietscript/vjs
- Fix Vite plugin: emit JS (trước đây trả về JSON AST)
- Fix Webpack plugin: same fix + source maps via
this.callback
@vietscript/stdlib— wrappers tiếng Việt cho JS globals- Console:
ghi,ghi lỗi,ghi cảnh báo - Ép kiểu:
tự số,tự chuỗi,tự bool,kiểu,độ dài - Math:
tròn,làm tròn xuống,làm tròn lên,giá trị tuyệt đối,nhỏ nhất,lớn nhất,ngẫu nhiên - Async:
đợi - JSON:
phân tích JSON,JSON sang chuỗi - Fetch:
tải văn bản,tải JSON
- Console:
- Tokenizer: specs order bị sai (prefix conflict
+vs+=) → reorder longest-first - Tokenizer: trailing non-ASCII char boundary (
xoá,chờ,khi mà,riêng tư,bảo vệ) dùng negative lookahead thay vì\b - Tokenizer: multi-word identifier nuốt embedded keyword (e.g.
x của arrthành 1 identifier) UnaryExpression: dùng Keyword enum thay vì string literalsBinaryExpression: supportinstanceof,inkeyword operators + bitwise opsContinueStatement: eatCONTINUEkeyword thay vìBREAKExpressionStatement: unwrapLabeledStatementkhi Expression trả về statement-likeStatementList: handle leading;asEmptyStatement(không infinite loop)UndefinedIdentifier: name ="undefined"lowercase (trước là"Undefined")ClassDeclaration: supportextendskeyword (ngoài dạng paren)- Docs: xóa JSON-based dummy output từ Vite/Webpack plugin
- State-machine tokenizer: char-code dispatch (
packages/parser/src/tokenizer.ts), keyword trie với 3 boundary kinds (WORDcho ASCII\b,IDENTcho keyword VI kết thúc non-ASCII,NONEcho keyword không cần biên), operator longest-match trie, bounded backtracking cho identifier đa-từ vs keyword đa-từ - Hạ tầng bench: 5 fixtures (tiny / medium / keywordHeavy / stringHeavy / large),
pnpm bench+pnpm bench:baseline(dump JSON) - Snapshot drift tests + smoke parity tests cho fixtures
- Doc:
docs/architecture/tokenizer.md
- Tests: 70 → 357 (100% pass)
- Coverage: 79.85% → 92.44% statements / 71.23% → 85.88% branches / 84.89% → 96.25% functions
- Compatibility matrix: 40.8% → 98.5% complete (135/137 features)
Initial parser skeleton, basic syntax support, playground.