danilopedraza / symstatic

The Symstatic programming language code repository
https://symstatic.org/book
GNU General Public License v3.0
2 stars 0 forks source link

`parser.rs` code quality #24

Open danilopedraza opened 3 months ago

danilopedraza commented 3 months ago

This file has almost 1k lines of code (two thirds are tests). The code has a lot of inlining and some repetition. The tests have a lot of repetition and are difficult to understand. This needs to be improved.

danilopedraza commented 2 months ago

the tests are much nicer to read now.

danilopedraza commented 2 months ago

The repetition was solved with helper functions, which also improved the appearance of instantiations like EnumName::EnumMember(Box::new(another_enum_member())).

danilopedraza commented 2 months ago

I should have done that from the beginning.

danilopedraza commented 1 month ago

This is getting bad again. I'm repeating a lot of code in the tests just to make them work. The problem is I don't know how to specify the necessary type parameter for Parser<T>.