millefoglie / latex-dom

LaTeX DOM Parser
0 stars 1 forks source link

Rework parser and node classes #1

Closed millefoglie closed 3 years ago

millefoglie commented 3 years ago

Introduced changes simplify parsing process by migration from complicated state transitions while reading input characters to processing a stream of typed tokens instead. The parser itself is simplified to special handling of certain token types and managing node scopes, i. e. correctly nesting nodes thus building a DOM tree. Node classes hierarchy now also contains less classes, since many node types are similar in behaviour, e. g. text and comment nodes or braces and brackets nodes. Finally, tests are migrated to Spock for more concise and readable code.