crytic / amarna

Amarna is a static-analyzer and linter for the Cairo programming language.
https://blog.trailofbits.com/2022/04/20/amarna-static-analysis-for-cairo-programs/
GNU Affero General Public License v3.0
148 stars 7 forks source link

Parser fails when file does not end with newline #20

Closed fcasal closed 2 years ago

fcasal commented 2 years ago

The cairo grammar does not support files without a newline. The compiler adds a newline, and we should do the same

https://github.com/starkware-libs/cairo-lang/blob/167b28bcd940fd25ea3816204fa882a0b0a49603/src/starkware/cairo/lang/compiler/parser.py#L241-L250