doctrine / lexer

Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
https://www.doctrine-project.org/projects/lexer.html
MIT License
11.07k stars 60 forks source link

Use correct syntax for assertions #103

Closed greg0ire closed 1 year ago

greg0ire commented 1 year ago

The previous syntax resulted in assertions having an impact on both cases when true and false were returned. Let us switch to equality assertions when we cannot deduce anything for the other case, and to a single assertion when we can deduce something in both cases.

See https://psalm.dev/docs/annotating_code/assertion_syntax/#equality-assertions See https://github.com/vimeo/psalm/issues/8896