docstring_parser
docstring_parser copied to clipboard
Please use FSM to analyze the docstring, do not use regular expression.
I originally thought that you would use lexical analysis and syntactic analysis from the principles of compilation, and analyze docstring through a finite state machine. However, when I took a look at the source code, I found that you were actually using regular expressions. The use of regular expressions will lead to a significant reduction in flexibility.
Creating a fully manual lexer and parser can be a tough task. While adding a library like parsimonious or lark could simplify things a lot, it would also add extra bulk to the package which I think should be avoided. That being said, I'm open to any pull requests if you'd like to explore different approaches.