Open Enter-tainer opened 3 months ago
I'm reading mitex's code currently and maybe I will write one.
The existing snapshots of lexer, parser, and converter would help you understand correctly, by simulating execution in your mind and compared with the snapshots.
btw, you can also make your owned testpoint in bug_playground
functions:
For example you write a snapshot assertion:
/// Convenient function to launch/debug a test case
#[test]
fn bug_playground() {
assert_debug_snapshot!(parse(r#"\frac{ a }{ b }"#), @"");
}
You can generate the snapshot fastly by cargo insta test --accept
. You can also launch debugging by code lenses over bug_playground
function to dive in execution:
mitex's design of spliting spec and parser/lexer is very clever and impressive. It however make it harder for people to understand what's happening. It would be better we can have a doc explaining what will happen when you type
#mi(
...)