Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture.md #146

Open
Enter-tainer opened this issue Mar 27, 2024 · 2 comments
Open

Architecture.md #146

Enter-tainer opened this issue Mar 27, 2024 · 2 comments

Comments

@Enter-tainer
Copy link
Member

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(...)

@Enter-tainer
Copy link
Member Author

I'm reading mitex's code currently and maybe I will write one.

@Myriad-Dreamin
Copy link
Collaborator

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:

/// Convenient function to launch/debug a test case
#[test]
fn bug_playground() {}
#[test]
fn test_easy() {
assert_debug_snapshot!(parse(r#"\frac{ a }{ b }"#), @r###"

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:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants