AST and parsers for the MoonBit programming language
Dependencies
.
├── tokens/ # token definitions and utilities
├── lexer/ # Lexical analysis components
├── mbti_ast/ # AST for .mbti files
├── mbti_parser/ # LR parser for .mbti files
├── syntax/ # AST and utils for MoonBit source code
├── handrolled_parser/ # Hand-written parser implementation
├── yacc_parser/ # LR parser generated by moonyacc
├── test/ # Test suite
└── top.mbt # parsing entries///|
test {
let source = "let number = 123"
let (impls, _) = parse_string(source)
@json.inspect(impls, content=[
{
"type": "Impl::TopLetDef",
"binder": { "type": "Binder", "name": "number", "loc": null },
"ty": null,
"expr": {
"type": "Expr::Constant",
"c": { "type": "Constant::Int", "0": "123" },
"loc": null,
},
"vis": { "type": "Visibility::Default" },
"is_constant": false,
"loc": null,
"attrs": [],
"doc": "",
},
])
}moon update
moon check
moon testAST and parsers for the MoonBit programming language
Dependencies