hegemonic / catharsis

A JavaScript parser for Google Closure Compiler and JSDoc type expressions.
MIT License
54 stars 14 forks source link

Add a lenient mode #8

Closed hegemonic closed 11 years ago

hegemonic commented 11 years ago

Before I can integrate Catharsis into JSDoc, the parser needs to support a lenient mode that's a little more forgiving than Closure Compiler.

When in lenient mode, the parser should support the following patterns, which have worked in JSDoc 3 for a while:

Also, we should maintain separate type caches for lenient-mode and strict-mode parsing.

hegemonic commented 11 years ago

A couple more changes for lenient mode, which is now extremely lenient indeed:

hegemonic commented 11 years ago

This change caused the tests to take about twice as long as before. I don't have good benchmarking data, so I'm not sure whether this is an across-the-board speed hit or whether it affects certain types more than others.

Based on when I first noticed the slowdown, I'm pretty sure that the culprit is type unions without parentheses.